jQuery自定义工具提示插件DarkTooltip js代码

版权:原创 更新时间:1年以上
[该文章底部包含文件资源,可根据自己情况,决定是否下载资源使用,时间>金钱,如有需要,立即查看资源]

以下是 jQuery自定义工具提示插件DarkTooltip js代码 的示例演示效果:

当前平台(PC电脑)
  • 平台:

部分效果截图:

jQuery自定义工具提示插件DarkTooltip js代码

HTML代码(index.html):

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="gb2312">
    <title>jQuery�Զ��幤����ʾ���DarkTooltip</title>
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/examples.css">
    <link rel="stylesheet" href="css/darktooltip.css">
</head>
<body id="home">
	<div id="fixed" class="box fixed-box" data-tooltip="I don't like to move" >I'm fixed</div>

	<main class = "main">

    	<h1>DarkTooltip</h1>
    	<section>
    		<div class = "example">
				<h2>Default</h2>
	    		<div id="def" class="box" data-tooltip="Hello world" >default</div>
	    	</div>
    	</section>

    	<section>
			<div class="example">
		    	<h2>on Click</h2>
		    	<div id="click-me" class="box" data-tooltip="Thanks for clicking me">
					Click me
		    	</div>
	    	</div>
    	</section>

		<section>
			<div class="example">
	    		<h2>HTML content</h2>
		    	<div id="def-html" class="box" data-tooltip="#html-content">
					html
		    	</div>
		    	<div id = "html-content" style="display:none;">
		    		<h2>wow <strong>such content</strong> very html</h2>
		    		<img src="http://bit.ly/18VOk3C">
		    	</div>
	    	</div>
	    </section>

    	<hr>

		<section>
			<div class="example">
	    		<h2>Confirm</h2>
		    	<div id="confirm" class="box" data-tooltip="Are you sure?">
					Click to delete
		    	</div>
	    	</div>
	    </section>
	    <br><br><br><br>
	    <section>
			<div class="example">
	    		<h2>Confirm with custom events</h2>
		    	<div id="confirm-light" class="box" data-tooltip="For real?">
					Click me too
		    	</div>
	    	</div>
	    </section>

    	<hr>

    	<section>
    		<div class="example">
				<h2>Sizes</h2>
				<div id="small-s" class="box" data-tooltip="Hey!">
					Small
		    	</div>
		    	<div id="medium-s" class="box" data-tooltip="Listen!">
					medium
		    	</div>
		    	<div id="large-s" class="box" data-tooltip="Watch out!">
					large
		    	</div>
	    	</div>
    	</section>

    	<hr>

    	<section>
    		<div class="example">
				<h2>Gravity</h2>
				<div id="south" class="box" data-tooltip="Hey!">
					gravity:south
		    	</div>
		    	<div id="west" class="box" data-tooltip="Listen!">
					gravity:west
		    	</div>
		    	<div id="north" class="box" data-tooltip="Watch out!">
					gravity:north
		    	</div>
		    	<div id="east" class="box" data-tooltip="Look!">
					gravity:east
		    	</div>
	    	</div>
    	</section>

    	<hr>

    	<section>
	    	<div class="example">
				<h2>Animations</h2>
				<div id = "effect-none" class = "box" data-tooltip="Simple but effective">
					none
		    	</div>
		    	<div id = "effect-flipin" class = "box" data-tooltip="Whooo!">
					flipIn
		    	</div>
		    	<div id = "effect-fadein" class = "box" data-tooltip="Hello there">
					fadeIn
		    	</div>
		    </div>
    	</section>

    	<hr>

    	<section>
	    	<div class="example">
				<h2>Themes</h2>
		    	<div id = "theme-dark" class = "box" data-tooltip="In Western culture, white and black traditionally symbolize the dichotomy of good and evil">
					dark
		    	</div>
		    	<div id = "theme-light" class = "box" data-tooltip="Metaphorically related to light and darkness and day and night">
					light
		    	</div>
	    	</div>
    	</section>
		<br><br>
    </main>
	<script src="js/jquery-1.10.2.min.js"></script>
	<script src="js/jquery.darktooltip.js"></script>
	<script src="js/examples.js"></script>
</body>
</html>

JS代码(examples.js):

$(document).ready( function(){
	$('#fixed').darkTooltip({
	gravity:'north'}
);
	$('#def').darkTooltip();
	$('#def-html').darkTooltip({
	opacity:1,gravity:'west'}
);
	$('#click-me').darkTooltip({
	trigger:'click',animation:'flipIn',gravity:'west'}
);
	$('#confirm').darkTooltip({
	trigger:'click',animation:'flipIn',gravity:'west',confirm:true,yes:'Sure',no:'No Way',finalMessage:'It has been deleted'}
);
	$('#confirm-light').darkTooltip({
	trigger:'click',animation:'flipIn',gravity:'west',confirm:true,theme:'light',onYes:function(){
	alert("This is a custom event for 'Yes' option");
}
,onNo:function(){
	alert("This is a custom event for 'No' option");
}
}
);
	$('#small-s').darkTooltip({
	size:'small',gravity:'south'}
);
	$('#medium-s').darkTooltip({
	gravity:'south'}
);
	$('#large-s').darkTooltip({
	size:'large',gravity:'south'}
);
	$('#south').darkTooltip({
	gravity:'south'}
);
	$('#west').darkTooltip({
	gravity:'west'}
);
	$('#north').darkTooltip({
	gravity:'north'}
);
	$('#east').darkTooltip({
	gravity:'east'}
);
	$('#effect-none').darkTooltip();
	$('#effect-flipin').darkTooltip({
	animation:'flipIn'}
);
	$('#effect-fadein').darkTooltip({
	animation:'fadeIn'}
);
	$('#theme-dark').darkTooltip();
	$('#theme-light').darkTooltip({
	theme:'light'}
);
}
);
	

CSS代码(examples.css):

body{font-family:"Helvetica Neue",Arial,sans-serif;font-size:14px;}
a,a:hover,a:visited{color:#666;}
.logo{width:150px;height:86px;display:inline-block;background-image:url(../img/logo.png);position:absolute;left:500px;top:20px;}
.logo a{color:#fff;position:relative;top:25px;left:35px;}
h1{font-size:24px;margin-bottom:15px;}
h2{font-weight:bold;margin-bottom:10px;}
.main{margin:40px;}
section{display:inline-block;width:100%;}
.options section{margin:20px 0;}
.example{float:left;margin:0 10px;}
.box{float:left;padding:10px;background-color:#eee;width:100px;margin:0 10px 10px 0px;text-align:center;}
.box.fixed-box{position:fixed;right:50px;top:50px;}
hr{margin:20px 0;color:#ddd;background-color:#ddd;height:2px;border:none;}
.code{width:650px;}
table.options th{font-weight:bold;color:#999;text-align:left;}
table.options thead{border-bottom:1px solid #ccc;}
table.options th,td{padding:5px 10px 5px 5px;}
table.options td:first-child{color:navy;}
附件:下载该文件资源,减少时间成本(增值服务)
留言
该资源可下载
File Source
.rar
40.50 KB
司徒馥颖真
了解
jquery特效7
最新结算
jquery虚拟键盘中文打字效果js代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
jquery虚拟键盘中文打字效果js代码
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
HTML5实现CSS滤镜图片切换特效代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
jQuery头像裁剪插件cropbox js代码
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
jQuery头像裁剪插件cropbox js代码
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 2.31¥ 状态: 待结算 详细>
CSS3制作3D图片立方体旋转特效
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
jQuery+css3实现信封效果
类型: .rar 金额: CNY 0.29¥ 状态: 待结算 详细>
我们力求给您提供有用的文章,再此基础上,会附加营收资源,不做任何广告,让平台可以更好发展 若您发现您的权利被侵害,或使用了您的版权,请发邮件联系 sunlifel@foxmail.com ggbig觉得 : 不提供源码的文章不是好文章
合作伙伴
联系我们
  • QQ:21499807
  • 邮箱:sunlifel@foxmail.com
  • QQ扫一扫加QQ
    QQ扫一扫
Copyright 2023-2024 ggbig.com·皖ICP备2023004211号-1
打赏文章