tags:

views:

158

answers:

1

This is my coding for Qtip.But it wont be work .I dont know why?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Qtip</title>
<script type="text/javascript" src="/jquery demos/jquery1.4.2.js"></script>
<script type="text/javascript" src="jquery.qtip-1.0.0-rc3.js"></script>
<script>
$(document).ready(function() 
{
   // Match all link elements with href attributes within the content div
  $("#content a[href]").qtip({
   content: 'This is an active list element',
   show: 'mouseover',
   hide: 'mouseout'   
  });    
});    
</script>
</head>    
<body>
  <a href='#'  id="content" class="qtip">sdfsfsd</a>    
</body>
</html>

Thanks in advance?

+1  A: 

Your selector is lookinf for <a href="something"> inside #content , so just remove that part, like this:

$("#content").qtip({
 content: 'This is an active list element',
 show: 'mouseover',
 hide: 'mouseout'   
});   

A space between selectors means look for descendants of matches of the preceding selector...the corrected, yet overkill selector would look like this: "a[href]#content", but...that's overkill (and therefore inefficient). The selector you're using is meant for the #content element to have links inside, like this:

<div id="content">
  <a href='#' class="qtip">sdfsfsd</a>  
</div>

Or just use the qtip class you already have, like this:

$(".qtip").qtip({
 content: 'This is an active list element',
 show: 'mouseover',
 hide: 'mouseout'   
});
Nick Craver