function preview()
{
bdhtml=window.document.body.innerHTML
sprnstr="<!--startprint-->"
eprnstr="<!--endprint-->"
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17)
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr))
window.document.body.innerHTML=prnhtml
window.print()
}</script>
//这次你直接运行!我这次真是 能帮你的都帮你了!<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
</style>
</head>
<body class="body">
<div class="showView">
<ul>
<li><img src="http://img6.bdstatic.com/img/image/smallpic/weimei1108.jpg"/></li>
<li><img src="http://img6.bdstatic.com/img/image/smallpic/chongwu1108.jpg"/></li>
<li><img src="http://img6.bdstatic.com/img/image/smallpic/mingxing1108.jpg"/></li>
<li><img src="http://img6.bdstatic.com/img/image/smallpic/touxiang1108.jpeg"/></li>
</ul>
</div>
<select name="select" class="choose" >
<option value="1">选项1</option>
<option value="2">选项2</option>
<option value="3">选项3</option>
<option value="4">选项4</option>
</select>
</body>
<script src="//cdn.bootcss.com/jquery/1.11.0/jquery.js" type="text/javascript" charset="utf-8"></script>
<script>
$('.showView ul li').eq(0).show().siblings().hide()
$('.choose').on('change', function (){
var index = $(this).val() - 1
$('.showView ul li').eq(index).show().siblings().hide()
})
</script>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)