弹出层之3:JQuery.tipswindow
2011-09-27 21:31
295 查看
tipswindow是一个很一般的JQuery弹出层插件,但使用简单,有相对漂亮的外观,代码比较通俗。下面介绍使用方法:
1、首先引入该插件相关文件,分别是样式,JQuery库,该插件
<link href="tipswindown.css" rel="stylesheet" type="text/css" />
<script src="../Contents/JS/jquery-1.5.js" type="text/javascript"></script>
<script src="tipswindown.js" type="text/javascript"></script>
2、修改tipswindow.css文件中图片的路径,默认与css文件在同一个目录下。
3、编写代码,如在图片上设置单击事件后放大显示图片:
<!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>
<link href="tipswindown.css" rel="stylesheet" type="text/css" />
<script src="../Contents/JS/jquery-1.5.js" type="text/javascript"></script>
<script src="tipswindown.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$("#imgTest").click(function() {
tipsWindown("标题:风景", "img:" + this.src, "640", "480", "true", "", "true", "img");
});
/*
function tipsWindown(title, content, width, height, drag, time, showbg, cssName)
title: 窗口标题
content: 内容(可选内容为){ text | id | img | url | iframe }
width: 内容宽度
height: 内容高度
drag: 是否可以拖动(ture为是,false为否)
time: 自动关闭等待的时间,为空是则不自动关闭
showbg: [可选参数]设置是否显示遮罩层(0为不显示,1为显示)
cssName: [可选参数]附加class名称
*/
});
</script>
</head>
<body>
<img src="../Contents/Images/wallpager/Autumn_A_1.jpg" width="400" height="300" id="imgTest" />
</body>
</html>
其它用法网友总结如下:
1.弹出文本信息提示:
tipsWindown("提示","text:提示信息内容","250","150","true","","true","msg")
2.弹出页面中的某个ID的html:
tipsWindown("标题","id:testID","300","200","true","","true","id")
3.弹出图片:
tipsWindown("图片","img:图片路径","250","150","true","","true","img")
4.get加载一个.html文件(也可以是.php/.asp?id=4之类的):
tipsWindown("标题","url:get?test.html","250","150","true","","true","text");
5.加载一个页面到框架显示:
tipsWindown("标题","iframe:http://leotheme.cn","900","580","true","","true","leotheme");
6.弹出一个不能拖动且没有遮罩背景的文本信息层:
tipsWindown("提示","text:提示信息内容","250","150","false","","false","msg")
7.弹出一个不能拖动,三秒钟自动关闭的层:
tipsWindown("提示","text:提示信息内容","250","150","false","3000","true","msg")
1、下载本文示例
2、下载官方最新示例与框架(推荐)
官网:http://leotheme.cn/javascript/jquery-plugins-tipswindow-2-0.html
1、首先引入该插件相关文件,分别是样式,JQuery库,该插件
<link href="tipswindown.css" rel="stylesheet" type="text/css" />
<script src="../Contents/JS/jquery-1.5.js" type="text/javascript"></script>
<script src="tipswindown.js" type="text/javascript"></script>
2、修改tipswindow.css文件中图片的路径,默认与css文件在同一个目录下。
3、编写代码,如在图片上设置单击事件后放大显示图片:
<!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>
<link href="tipswindown.css" rel="stylesheet" type="text/css" />
<script src="../Contents/JS/jquery-1.5.js" type="text/javascript"></script>
<script src="tipswindown.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$("#imgTest").click(function() {
tipsWindown("标题:风景", "img:" + this.src, "640", "480", "true", "", "true", "img");
});
/*
function tipsWindown(title, content, width, height, drag, time, showbg, cssName)
title: 窗口标题
content: 内容(可选内容为){ text | id | img | url | iframe }
width: 内容宽度
height: 内容高度
drag: 是否可以拖动(ture为是,false为否)
time: 自动关闭等待的时间,为空是则不自动关闭
showbg: [可选参数]设置是否显示遮罩层(0为不显示,1为显示)
cssName: [可选参数]附加class名称
*/
});
</script>
</head>
<body>
<img src="../Contents/Images/wallpager/Autumn_A_1.jpg" width="400" height="300" id="imgTest" />
</body>
</html>
其它用法网友总结如下:
1.弹出文本信息提示:
tipsWindown("提示","text:提示信息内容","250","150","true","","true","msg")
2.弹出页面中的某个ID的html:
tipsWindown("标题","id:testID","300","200","true","","true","id")
3.弹出图片:
tipsWindown("图片","img:图片路径","250","150","true","","true","img")
4.get加载一个.html文件(也可以是.php/.asp?id=4之类的):
tipsWindown("标题","url:get?test.html","250","150","true","","true","text");
5.加载一个页面到框架显示:
tipsWindown("标题","iframe:http://leotheme.cn","900","580","true","","true","leotheme");
6.弹出一个不能拖动且没有遮罩背景的文本信息层:
tipsWindown("提示","text:提示信息内容","250","150","false","","false","msg")
7.弹出一个不能拖动,三秒钟自动关闭的层:
tipsWindown("提示","text:提示信息内容","250","150","false","3000","true","msg")
1、下载本文示例
2、下载官方最新示例与框架(推荐)
官网:http://leotheme.cn/javascript/jquery-plugins-tipswindow-2-0.html
相关文章推荐
- 弹出层之3:JQuery.tipswindow
- 弹出层之3:JQuery.tipswindow
- XYTipsWindow 2.8,一个基于jQuery的弹出层
- 弹出层之3:JQuery.tipswindow
- XYTipsWindow 2.8 ,一款轻量级Jquery弹窗插件!
- JQuery弹出层效果制作 TipsWindown
- 一个jQuery弹出层(tipsWindown)
- 炼狱:window.createPopup()弹出提示tips
- jQuery的offset()实现鼠标悬停即弹出Tips
- jquery插件——弹出层(Tipswindown)
- jquery-easyui:window或dialog 中弹出的多个窗口中不能含相同的名称的form 或 input
- 一个jQuery弹出层(tipsWindown)
- bootstrap-datepicker时间插件和chosen.jquery下拉模糊搜索和bootbox.min弹出框以及jquery.tips提示框和js的全选与取消的使用
- jquery插件——弹出层(Tipswindown)
- 一个基于jQuery的弹出层插件XYTips
- 一个jQuery弹出层(tipsWindown)
- 小tips:jquery datapicker中,用图片按钮弹出日历框
- 解决jquery.XYTipsWindow.2.8.js关闭后父窗体输入框不能进行编辑
- XYTipsWindow、jquery-1.4.4.min.js和Object doesn't support this property or method 解决
- 封装jquery弹出窗口