jQuery使用一个按钮控制图片的伸缩
2013-04-17 19:55
381 查看
<!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>
<title></title>
<style type="text/css">
#img1
{
width: 500px;
height: 400px;
border: solid 1px #ccc;
display:none;
}
</style>
<script src="jquery-1.9.1.js" type="text/javascript"></script>
<script type="text/javascript">
var count = 0;
$(function () {
$('#Button1').click(function () {
if (count % 2 != 0) {
$('#img1').hide(5000);
}
else {
$('#img1').show(5000);
}
count++;
})
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<img id="img1" src="images/1.jpg" />
<input id="Button1" type="button" value="点我看看" />
</div>
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
#img1
{
width: 500px;
height: 400px;
border: solid 1px #ccc;
display:none;
}
</style>
<script src="jquery-1.9.1.js" type="text/javascript"></script>
<script type="text/javascript">
var count = 0;
$(function () {
$('#Button1').click(function () {
if (count % 2 != 0) {
$('#img1').hide(5000);
}
else {
$('#img1').show(5000);
}
count++;
})
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<img id="img1" src="images/1.jpg" />
<input id="Button1" type="button" value="点我看看" />
</div>
</form>
</body>
</html>
相关文章推荐
- jQuery使用一个按钮控制图片的伸缩实现思路
- jQuery使用一个按钮控制图片的伸缩实现思路
- 使用jQuery同时控制四张图片的伸缩
- 使用jQuery同时控制四张图片的伸缩实现代码
- 使用jQuery同时控制四张图片的伸缩实现代码
- 【实践】纯jquery实现图片滑动无缝轮播,带左右按钮及控制按钮
- 使用jquery实现的一个图片延迟加载插件(含图片延迟加载原理)
- JQUERY JFLOW图片滚动插件左右按钮控制图片内容滑动切换
- 怎样用jquery实现点击一个按钮控制一个div的显示和隐藏
- jquery仿QQ商城带左右按钮控制焦点图片切换滚动效果
- 在jquery用一个按钮实现全选/全不选的效果(attr和prop的区别使用)
- JQuery左右按钮控制图片 文字向上滚动自定义插件
- ZoomControls控件是一个可以缩放控件,可以实现两个按钮控制图片的大小
- jQuery实现图片轮播且鼠标可控制显示,使用animate函数
- 使用js实现带有停顿效果的图片滚动(按钮控制)
- 使用jQuery开发一个基于HTML5的漂亮图片拖拽上传web应用
- 使用js实现带有停顿效果的图片滚动(按钮控制)
- 使用jquery实现点击一个按钮或连接,让它下面的div显示,在点击一下隐藏
- 使用CSS给ASP.NET中的Button按钮添加一个指定位置的图片
- 使用jQuery开发一个基于HTML5的漂亮图片拖拽上传web应用