drop down menu - jQuery - improve/reduce my ipod-style dropdown code! - challenge? -


Inspiring from this

I have created my own from scratch For client I need this clever dropdown solution, but more lightweight & amp;

Demo:

/ Ul>

Because it is a proof o concept, know Good to be, in a plugin before the port, what do you think about it!

Is good, bad or can the shape be improved or reduced?

I am happy to share this code with you and if you want to give me some feedback, then it will be good! ; -)

PS: Fully work in IE6 +, Firefox, Chrome, Opera and definitely support jQuery theme roller and there are zero configuration steps!

Thanks guys!

Looks good.

One thing I would say if you are going to use them more than once, and trying to take advantage of Chenning, they should try to store the jQuery objects in one variable .

At the beginning of the code like this:

  var $ ipod_box = $ ('. Ipod_select_box'); // archived reference $ ipod_box.addClass ('ui-widget-content ui-corner-all') // Usage Chaining .Fund ('ul: eq (0)'). Attr ('class', 'ipod_main_ul'); $ Ipod_box.find ('li a: eq (0)'). Attr ('class' ...  

and this:

  var $ Ipod_box_a = $ ipod_box.find ('ul li a'); // The archived reference is $ ipod_box_a.each (function (e) {$ th = $ (this); // archived reference if ($ th.next). ('Ul')) {$ th.next (). Attr ( 'Class', 'ipod_sub') Hide (); ... $ ipod_box_a.hover (...  

In addition, in some places, you prevAll () < / Code> and prevNext () together, when you can only use siblings () .

Here Like:

  $ ipod_li.siblings (). Hide (); // brothers instead of prevAll () nextAll ()  

In addition to , when you Hali bars hover over a menu item, it seems that something like this happens, it seems that something happens. It seems that it seems that there is no limit where there was no one before. / P>> You may want to resize all menu items so that they all have a boundary that corresponds to the background color. Then when you rotate on one, you just

good looks like.


Comments