GumaxDD: Faster Dropdown

Use this forum to ask questions about how to do things in GuMax skin.
User avatar
BRotondi
Rank 5
Rank 5
Posts: 25
Joined: March 15th, 2009, 5:35 am
Contact:

GumaxDD: Faster Dropdown

Post by BRotondi »

Hello

I don't need any roll-down-effect or similar. A simple and fast Dropdown would be nice. Is this possible? Where?

Thanks!
Bruno
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: GumaxDD: Faster Dropdown

Post by Paul »

The effect comes from two JavaScripts under folder js, they are popular JavaScript Library, I didn't modify anything of it, you can hack into it if you have time and JavaScript skills. :lol:
User avatar
BRotondi
Rank 5
Rank 5
Posts: 25
Joined: March 15th, 2009, 5:35 am
Contact:

Re: GumaxDD: Faster Dropdown

Post by BRotondi »

Thanks for the info!

My changes in jquery.droppy.js

Code: Select all

    function hide() {
      var subnav = getSubnav(this);
      if (!subnav) return;
      $.data(subnav, 'cancelHide', false);
      setTimeout(function() {
        if (!$.data(subnav, 'cancelHide')) {
          $(subnav).slideUp(options.speed);
        }
      }, 500);
    }
- Timer for hiding the menu set to 0 instead of 500
- options.speed can be replaced (milliseconds for closing, 0=Default), it's o.k. this way since very fast

Code: Select all

    function show() {
      var subnav = getSubnav(this);
      if (!subnav) return;
      $.data(subnav, 'cancelHide', true);
      $(subnav).css({zIndex: zIndex++}).slideDown(options.speed);
      if (this.nodeName.toLowerCase() == 'ul') {
        var li = getActuator(this);
        $(li).addClass('hover');
        $('> a', li).addClass('hover');
      }
    }
- options.speed replaced by 1, since I want it very fast

Bruno
User avatar
BRotondi
Rank 5
Rank 5
Posts: 25
Joined: March 15th, 2009, 5:35 am
Contact:

Re: GumaxDD: Faster Dropdown

Post by BRotondi »

And some more settings for interested users: gumax_droppy.css

Code: Select all

#gumax-nav li.hover a, #gumax-nav ul li a { background-color: #5e5a5a; /* drop down background */ }

#gumax-nav a.hover, #gumax-nav ul a.hover { background-color: #999; color: #eee; }
#gumax-nav ul { border: none; opacity: 0.9; filter: alpha(opacity=90); }
- 5e5a5a = dropdown color
- 999 / eee = color background/font when selected
- 0.9 = opacity

I set opacity = 1, since it's more clear, but: Your settings are nicer :)

Bruno
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: GumaxDD: Faster Dropdown

Post by Paul »

Nice work ... :D

Also, in GuMax.php, there is speed that you can tweak,

Code: Select all

$(function() { $('#gumax-nav').droppy({speed: 100}); });
The "speed:100" is the menu speed. :D
User avatar
BRotondi
Rank 5
Rank 5
Posts: 25
Joined: March 15th, 2009, 5:35 am
Contact:

Re: GumaxDD: Faster Dropdown

Post by BRotondi »

Ah! Yes... perhaps it's more logical to change the speed when calling the function instead of changing the function itself :D
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: GumaxDD: Faster Dropdown

Post by Paul »

I can see many users put attention on this speed, it might be a good idea to move this speed to LocalSettings.php, and this will be easy for people... :lol:
User avatar
BRotondi
Rank 5
Rank 5
Posts: 25
Joined: March 15th, 2009, 5:35 am
Contact:

Re: GumaxDD: Faster Dropdown

Post by BRotondi »

What do you think about a setting.php or settings.css (don't know if possible) for each of your styles? There you can put defaultvalues and explain them.

I preferr not to overload LocalSettings ... and this way the code would easily be ignored when using another style.

Anyway: Enjoy your ideas, concept, job & hobby :)
Bruno
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: GumaxDD: Faster Dropdown

Post by Paul »

Your idea is good too, however users might forget the extra setting.php file, I think LocalSetting.php is OK, since it only be loaded once, but the setting.php will be loaded every page though.

I will think another way... keep it simple for now... :lol:
User avatar
BRotondi
Rank 5
Rank 5
Posts: 25
Joined: March 15th, 2009, 5:35 am
Contact:

Re: GumaxDD: Faster Dropdown

Post by BRotondi »

LocalSetting.php will be loaded every page too, as much as I understood from php... since there is no server side cache or similar...
Post Reply