Qtip doesn't work for me?

This is my coding for Qtip. But that will not work. I do not know why?

<!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">
<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?

+3
source share
1 answer

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

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

The space between the selectors means searching for the descendants of the matches of the previous selector ... the adjusted, but the brute force switch will look like this: "a[href]#content"but ... it's redundant (and therefore inefficient). The selector you use is for the element #contentto have links inside, for example:

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

Or just use the class qtipyou already have, for example:

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

Source: https://habr.com/ru/post/1747970/


All Articles