Jump to content
Search Community

chief_wolfinjo

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by chief_wolfinjo

  1. Hello :)

     

    I am using this code :

    jQuery(document).ready(function() {
    jQuery(function () {    
      jQuery('#categories.nav li, #pages.nav li').hover(function () {
        jQuery('ul', this).stop(true, true).delay(200).slideDown(200);
      }, function () {
        jQuery('ul', this).stop(true, true).slideUp(200);
      });
    });
    });
    

    This code is not working well. For example, when I open the homepage of my wp theme and I mouseover the menu, jquery doesn't work on the first try (so the submenu works normally without the jquery effect). However, it does work from the second attempt onwards.

    If I go to another page or I refresh the current page, jQuery doesn't work initially but again, it starts to work on the second attempt...

     

    Can you explain why this happens?

     

    I would welcome suggestions for a better solution, I just want my submenu to act the same as yootheme or similiar. (I am testing this wordpress theme on localhost)

     

    Thank you!! :)

  2.  

    Hi and welcome to the forums;

     

    The selector "#categories.nav li ul" is unordered list, so unless it have unique ID (TweenLite have own very small selector engine working with IDs ), you have to select it first with pure JS or some selector engine. If you're working with Wordpress theme there is high chance that jQuery is included in the website, so you can use jQuery to select the element you want and then animate it with TweenLite. You can try 

     

    <script type="text/javascript">
    
    $(function(){
        TweenLite.to($("#categories.nav li ul"), 1, {left:"632px"});
    });
    
    </script>

     

    Hi :)

     

    thank you for the reply, yes i will try this now. and yes my wp theme is calling jQuery

    in separate like this :

    wp_enqueue_script( 'jquery' );
    
  3. Hello :)

     

    I have a Wordpress theme where i want to use GSAP JS for my Menu specifically for my submenu

    and I've tried a few basic examples and they all work but when i want to use GSAP JS for this element :  #categories.nav li ul , then is not working... How GSAP JS can work with this element : #categories.nav li ul ? This element is for submenu of my Menu.

     

    please tell me on basic example below how can i do it ?

     

    <script>
    window.onload = function(){
        var logo = document.getElementById("logo");
        TweenLite.to(logo, 1, {left:"632px"});
    }
    </script>
     
    Thank you !!!!

     

×
×
  • Create New...