简体   繁体   中英

Simple qtip2 example does not work

I'm trying to get a simple qtip2 demo running but it wont work need help. qtip2 is a framework that allows to create individual tooltips. if you hover over the link a small yellow box should appear.

all files are in the same folder.

 <html> <head> <title>My site</title> <!-- CSS file --> <link type="text/css" rel="stylesheet" href="jquery.qtip.css" /> </head> <body> <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.qtip.js"></script> <script type="text/javascript" src="jquery.imagesloaded.pkg.min.js"></script> <a href="#test" title="My tooltip text">Sample link</a> <script> // self executing function here (function() { // your page initialization code here // the DOM will be available here $('a[title]').qtip(); })(); </script> <a href="#test" title="My tooltip text">Sample link</a> </body> </html> 

i removed unnessesary codes like the imagesloaded and replace the jQuery link you have with a CDN version.

And it works.

<html>
<head>
<title>My site</title>
<!-- CSS file -->
<link type="text/css" rel="stylesheet" href="jquery.qtip.css" />
</head>

<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js">          </script>
<script type="text/javascript" src="jquery.qtip.js"></script>
<a href="#test" title="My tooltip text">Sample link</a>
<script>
// self executing function here
(function() { $('a[title]').qtip(); })(); </script>
<a href="#test" title="My tooltip text">Sample link</a>
</body>
</html>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM