我是靠谱客的博主 酷炫小天鹅,这篇文章主要介绍jquery 实现简单的切图,现在分享给大家,希望可以做个参考。

<!DOCument html>
<html lang="zh_CN">
<head>
<style>
.div{width:500px; height:400px;border:1px red solid;margin:0 auto;}
</style>
<script src="jquery/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('p#n1').hide();
$('p#n2').hide();
$("button.a1").click(function(){
$('p#n1').hide();
$('p#n2').hide();
$('p#n3').show();
});
$("button.a2").click(function(){
$('p#n1').show();
$('p#n2').hide();
$('p#n3').hide();
});
$("button.a3").click(function(){
$('p#n1').hide();
$('p#n2').show();
$('p#n3').hide();
});

});
</script>
</head>
<body>
<div class="div">
<p id="n1"><img src="./images/2.jpg" width="499px;" height="400px"></p>
<p id="n2"><img src="./images/5.jpg" width="499px;" height="400px;"></p>
<p id="n3"><img src="./images/1.jpg" width="499px;" height="400px;"></p>
</div>
<button class="a1">第一张</button>
<button class="a2">第二张</button>
<button class="a3">第三张</button>
</body>
</html>

最后

以上就是酷炫小天鹅最近收集整理的关于jquery 实现简单的切图的全部内容,更多相关jquery内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(65)

评论列表共有 0 条评论

立即
投稿
返回
顶部