Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 620
  • Last Modified:

Facebox / JQuery Show and Hide

Hi EE-Team

I have a little Problem ...
I want to show a Facebox by onmouseover and hide it by onmouseout ...

The Show-Part works, but the Hide-Part not ...

Hope you can help ... Thanx Talki

Here is my test ...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>Facebox 1.2</title>
  <link href="../src/facebox.css" media="screen" rel="stylesheet" type="text/css" />
  <script src="../lib/jquery.js" type="text/javascript"></script>
  <script src="../src/facebox.js" type="text/javascript"></script>
  <script type="text/javascript">
    jQuery(document).ready(function($) {
      $('a[rel*=facebox]').facebox({
        loadingImage : '../src/loading.gif',
        closeImage   : '../src/closelabel.png'
      })
    })
  </script>
 
  <script type="text/javascript">
      function ShowMyBox () {
          jQuery.facebox({ ajax: 'remote.html' });
      }
  </script>

  <script type="text/javascript">
      function HideMyBox () {
//          jQuery.facebox().close();
//          $(document).trigger('close.facebox');
          $.facebox.close();
      }
  </script>
 
</head>

<body>
      
      <img src="images/logo.png" onmouseover="ShowMyBox();"  onmouseout="HideMyBox();"><br />

</body>
</html>
0
Klaus Talkenberger
Asked:
Klaus Talkenberger
1 Solution
 
askurat1Commented:
Well you could try and make sure you put "/" at the end of your img tag:
<img src="images/logo.png" onmouseover="ShowMyBox();"  onmouseout="HideMyBox();" /><br />

Open in new window

0
 
leakim971PluritechnicianCommented:
Check the following to see if it help :

ref : http://api.jquery.com/hover/
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Facebox 1.2</title>
<link href="http://defunkt.io/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<script src="http://defunkt.io/facebox/facebox.js" type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(function($) {
		$('a[rel*=facebox]').facebox({
			loadingImage : '../src/loading.gif',
			closeImage   : '../src/closelabel.png'
		})
		$("img").hover(function() {
			$.facebox({ ajax: 'remote.html' });
		},function() {
			$.facebox.close(); 
			//setTimeout("$.facebox.close()", 1000); 
		});
	})
</script>
</head>
<body>
	<img src="http://www.experts-exchange.com/expert/images/logo.jpg"><br />
</body>
</html>

Open in new window

0
 
abhisheksimionCommented:
Do you have a link where we can take a look at the working part?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now