z-smart-zoom-jquery.js图⽚缩放插件的使⽤以及点击复选框将其下的缩略图显
⽰⼤图
⼀、引⼊⽂件
<script src="./lib/jquery/jquery.js"></script>
<script src="./lib/smartJQueryZoom/src/e-smart-zoom-jquery.js"></script>
⼆、html
<div class="head">
<div class="box">
<ul class="clearfix">
<li>
<p class="describe">
jquery下载文件插件
<input class="checkbox" type="checkbox" name='picture' value="picture1.jpeg" />
<span>好看的图⽚</span>
</p>
<p class="picture"><img src="images/picture1.jpeg" alt=""></p>
</li>
<li>
<p class="describe">
<input class="checkbox" type="checkbox" name='picture' value="picture2.jpeg" />
<span>好看的图⽚</span>
</p>
<p class="picture"><img src="images/picture2.jpeg" alt=""></p>
</li>
<li>正则表达式匹配符简写
<p class="describe">
<input class="checkbox" type="checkbox" name='picture' value="picture3.jpeg" />
<span>好看的图⽚</span>
</p>
<p class="picture"><img src="images/picture3.jpeg" alt=""></p>
</li>
<li>
<p class="describe">
<input class="checkbox" type="checkbox" name='picture' value="picture4.jpeg" />
<span>好看的图⽚</span>编程猫离职
</p>
<p class="picture"><img src="images/picture4.jpeg" alt=""></p>招聘小程序怎么做
</li>
<li>
<p class="describe">
<input class="checkbox" type="checkbox" name='picture' value="picture5.jpeg" />
<span>好看的图⽚</span>
</p>
<p class="picture"><img src="images/picture5.jpeg" alt=""></p>
</li>
</ul>
</div>
</div>
<div class="body">
<div class="box">
<div class="btns">
<p>
<span id="enlarge">+</span>
<span id="reduce">-</span>
</p>
</div>
<div class="images"></div>
shell表达式</div>
</div>
三、jquery
$("input[type='checkbox']").click(function() {
var picname = new Array;
$("input[type='checkbox']:checked").each(function(key, value) {
picname[key] = $(value).val();
})
if (picname[picname.length - 1] != undefined) {
$(".images").html('<img id=bigimg class=bigimg src=images/' + picname[picname.length - 1] + ' alt="图⽚">'); // 缩放插件使⽤
$(".images img").smartZoom()
}
else {
$(".images").empty();
}
})
//放⼤按钮
fontfamily$("#enlarge").click(function() {
var scaleToAdd = 0.6;
var img = $('.images img');
if (img.length > 0)
$('.images img').smartZoom('zoom', scaleToAdd);
})
//缩⼩按钮
$("#reduce").click(function() {
var scaleToSub = -0.6;
var img = $('.images img');
if (img.length > 0)
$('.images img').smartZoom('zoom', scaleToSub);
})
页⾯
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论