效果图
介绍
- 无需其他JavaScript编码
- 没有其他HTML片段
- 没有额外的CSS资源
- 没有其他图标/资产
- 无需额外处理动态内容和事件侦听器
引入JS文件
<script type="text/javascript" src="/js/ImageBox.js"></script>
<script type="text/javascript">
jQuery(function($){$("img[src$=jpg],img[src$=gif],img[src$=png],img[src$=jpeg]").addClass("spotlight").each(function(){this.onclick=function(){return hs.expand(this)}});})
</script>
使用方法
将代码插入到全局文件中一般是head.php或footer.php都是可以的。
若希望支持更多图片格式添加只需要填写img[src$=格式]
即可。