开发者

Drop Down menu using jquery

I am using Phonegap and i am new to both phonegap as well as jquery. I needed to know if i can have a drop down button using jquery. Appreciate your help.

$(document).ready(function(){
         
            $('.down-li开发者_如何学编程st').width($('.dropdown-menu').width()-2);
         
            $('.dropdown-menu').hover(
              function () {
                $('.menu-first', this).addClass('slide-down');
                $('.down-list', this).slideDown(100);
              },
              function () {
                obj = this;
                $('.down-list', this).slideUp(100, function(){ $('.menu-first', obj).removeClass('slide-down'); });
              }
            );
         
        });

this code doesn seem to work. It just gives me the text on android emulator. Any suggestions?

Thanks a lot in advance.


Have you solved the problem? If not, you should look into using jquery mobile and why did you want to use jquery to create a drop-down? I am guessing you want to "beautify" the drop-down? Another option is to look at html5 and css3 based drop-downs as those will be hardware accelerated; depending on jquery too much will only make your app run slower because it is being run inside a browser (phonegap)

Update:

From personal experience I have realized that you should look into micro frameworks like Zepto or XUI or jqMobi. I have personally used Zepto and have noticed significant improvements in performance compared with jQM and jQ. All of the frameworks I just mentioned use jQ style syntax so porting to them will not be a problem.

I have blogged about PhoneGap(now Cordova) at http://codejournal.wordpress.com/2012/02/19/what-i-can-use-htmljavascriptcss-for-native-mobile-apps/. I have blogged about other useful stuff for mobile that you can use.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜