Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Page & Category Menu Bars (http://forum.bytesforall.com/forumdisplay.php?f=10)
-   -   Mouse Out Delay on Menus (http://forum.bytesforall.com/showthread.php?t=20342)

IILLC May 16, 2013 12:42 PM

Mouse Out Delay on Menus
 
I would like to add a delay to the menus collapsing when you mouse out of a menu. This is so users can easily navigate to sub menus without having to be 100% sure they are staying on the items.

What would be the best way to do this in Atahualpa?

Thank you for your help.

juggledad May 16, 2013 01:56 PM

Quote:

What would be the best way to do this in Atahualpa?
any way you can. seriously, if you are using the 'Animate Page Menu Bar' option, then you should do a google search you will have to edit and change the jscript code that handles that function.

Post your results for others when you get it working.

IILLC May 16, 2013 04:13 PM

Can you point me to what file has the code in it that checks for animated menus and where the jscript is stored?

juggledad May 16, 2013 04:26 PM

Not at home now, but look in the theme folder for a jscript folder - it's in there

IILLC May 16, 2013 07:52 PM

Ya it is in the js.php file.

I can mod the behavior somewhat but am having issues. I found a script that may work but I can't get the

Code:

<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
to inject before moding the js.php file. When I put it in the optional includes area for the theme options it puts the reference in after the script so I don't think it is working.

Here is the script I want to mod.


Code:

        <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
        <script>
              $(document).ready(function()
              {
                      $('li').hover(function(){
                        var timer = $(this).data('timer');
                        if(timer) clearTimeout(timer);
                        $(this).addClass('over');
                      },function(){
                        var li = $(this);
                        li.data('timer', setTimeout(function(){ li.removeClass('over'); }, 500));
                      });
              });
          </script>

Here is my modded code.
Code:

/* JQUERY */
$(document).ready(function(){
<?php if ( $bfa_ata['animate_page_menu_bar'] == "Yes" AND strpos($bfa_ata['configure_header'],'%page')!== FALSE ) { ?>
    $("#rmenu2 li.rMenu-expand").hover(function(){
    jQuery(this).find('ul.rMenu-ver:first').css({"display":"block","position":"absolute"});
    jQuery(this).find('ul.rMenu-ver:first li').css({"display":"none"}).slideDown(200);
    var timer = $(this).data('timer');
    if(timer) clearTimeout(timer);
    $(this).addClass('over');       
  },function() {
    jQuery(this).find('ul.rMenu-ver:first').css("display","block");
    jQuery(this).find('ul.rMenu-ver:first li').css("display","block").slideUp(1000);
        jQuery(this).find('ul.rMenu-ver:first').slideUp(1000);
    var li = $(this);
    li.data('timer', setTimeout(function(){ li.removeClass('over'); }, 500));
  });
   
<?php } ?>

I'm pretty sure I can add these lines into the JQuerry function if I can just get that script to be referenced first. If I'm understanding this correctly it is adding timer into it so that it can hold the menu open for a short time. I'm pretty new to jquerry and all of the add ons it has. So I may be way off base. ;)

Here is the page that was linked in stackexchange that functions like I want these menus to. http://jsbin.com/otapex/2

If I can get this to work then I will work out something I can put in a child theme for the site that should work through updates.


All times are GMT -6. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.