www.webdeveloper.com
Results 1 to 3 of 3

Thread: if hover or focus, if out and blur

  1. #1
    Join Date
    Feb 2009
    Location
    Norway
    Posts
    67

    if hover or focus, if out and blur

    Hi! I have this script for a Google search-box (jQuery):
    Code:
    	$('#Search').hover(
    		function () {
    		$('#Google').show();
    		},
    		function () {
    		$('#Google').hide();
    		}
    	);
    I need however to include if $('#Google').focus OR $('#Search').hover( $('#Google').show) ..
    and the callback should be like if #Search.hover out AND #Google.blur ..

    Do you understand what I mean?
    How do I do this?

    Thanks!

  2. #2
    Join Date
    Feb 2009
    Location
    Norway
    Posts
    67
    I tried this:
    Code:
    	if (
    	$('#Search').hover() ||	$('#Google').focus() )
    		{$('#Google').show() }
    	else {
    		$('#Google').hide() 
    		};
    But seems like it always results in the Google.show. Any suggestions?

  3. #3
    Join Date
    Feb 2009
    Location
    Norway
    Posts
    67
    My html is like this:
    Code:
    <div id="Search">
    <a href=#>Search site</a>
      <div id="Google" >
       Google search..
      </div>
    </div>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles