Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Page & Category Menu Bars »

Mouse Out Delay on Menus


  #1  
Old May 16, 2013, 01:42 PM
IILLC
 
7 posts · Feb 2013
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.
  #2  
Old May 16, 2013, 02:56 PM
juggledad's Avatar
juggledad
 
23,551 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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.
  #3  
Old May 16, 2013, 05:13 PM
IILLC
 
7 posts · Feb 2013
Can you point me to what file has the code in it that checks for animated menus and where the jscript is stored?
  #4  
Old May 16, 2013, 05:26 PM
juggledad's Avatar
juggledad
 
23,551 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Not at home now, but look in the theme folder for a jscript folder - it's in there
  #5  
Old May 16, 2013, 08:52 PM
IILLC
 
7 posts · Feb 2013
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.

Bookmarks

Tags
customization, delay, menus, mouse out

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call for other donors: put a slight delay on menus collapsing heimir Customization, Design, Programming... 0 Feb 28, 2011 08:45 PM
Delay before menu collapse heimir Page & Category Menu Bars 0 Nov 19, 2010 06:47 AM
Delay in changes taking effect? Jerry Atahualpa 3 Wordpress theme 11 Jan 7, 2010 03:59 PM


All times are GMT -6. The time now is 05:02 PM.


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