最好用插件,去layer官网有专门的点击图片,弹出浏览还支持多个图片。
先去官网下载layer包,你的网页引用layer的js文件。
地址:网页链接 点击相册层
然后js代码:
//调用示例
layer.ready(function(){ //为了layer.ext.js加载完毕再执行
var ps=$("#psize").val()
layer.photos({
photos: '#layer-photos-demo'
,shift: ps //0-6的选择,指定弹出图片动画类型,默认随机
})
})
html代码:
<div id="layer-photos-demo" class="layer-photos-demo" >
<img layer-pid="图片id,可以不写" layer-src="缩略图片地址" src="图片地址" alt="" style="height: 140pxwidth: 120pxborder:1px solid #bbb">
</div>
jquery的toggleClass()可以轻松实现...<style>
.max{width:XX%height:auto}/* 根据自己的需要去自行设置 */
.min{width:XXpxheight:auto}/* 根据自己的需要去自行设置 */
<style>
<html>
<body>
<img id='img' class='min' src='xxxx'>
</body>
</html>
<script>
$('#img').click(function(){
$(this).toggleClass('min')
$(this).toggleClass('max')
})
</script>
没有例子,不太明白你想要什么。。。。从图看职能是ps出来的切到网站上不过做图表的特效倒是有,和你给的不太一样
你看看这个是不是你想要的效果
http://hci.stanford.edu/jheer/files/zoo/ex/networks/force.html
下面是合集地址
http://queue.acm.org/detail.cfm?id=1805128