我试图获得一个简单的qtip2演示运行,但它不会工作,需要帮助。qtip2是一个允许创建单个工具提示的框架。如果您悬停在链接上,应该会出现一个小的黄色框。
所有文件都在同一个文件夹中。
<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>
发布于 2016-06-12 08:45:38
我删除了一些不必要的代码,比如图像加载,并用CDN版本替换了您的jQuery链接。
而且它是有效的。
<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>https://stackoverflow.com/questions/37772094
复制相似问题