Wordpress - Submenu drop down menu jquery slideDown not working good - why

Wordpress - Submenu drop down menu jquery slideDown not working good - why

i am developing a Wordpress theme and i want that my menu / submenu have effect like this :

http://www.yootheme.com/demo/wordpress/glass

so i have this code in my wordpress theme for submenu :


  1.     if ( jQuery(window).width() > 985) {
        jQuery(function () {   
          jQuery('#categories.nav li, #pages.nav li').hover(function () {
             clearTimeout(jQuery.data(this, 'timer'));
             jQuery('ul', this).stop(true, true).slideDown(500, 'easeInOutCubic');
          }, function () {
            jQuery.data(this, 'timer', setTimeout(jQuery.proxy(function() {
              jQuery('ul', this).stop(true, true).slideUp(500, 'easeInOutCubic');
            }, this), 500));
          });
        });
        }











  

 
but this code is not working good for example, when i open the homepage of my wp theme
and i go with mouse over the menu to see how the submenu is working always on the first try jquery is not working at all so submenu is working normal without jquery effect, submenu starts to work always from second attempt and if i go to next page or i refresh the page than again jqeury is not working and he starts to work from second attempt...

please tell me why ?

and do you have a suggestion for a better solution , i just want that my submenu acts same as yootheme or very similiar.

and i am testing this wordpress theme on localhost.

Thank you !!!! :)


















    • Topic Participants

    • ivan