内容简介:perfundo是一款纯CSS3 lightbox插件。使用它可以轻松创建单张或多张图片的弹出lightbox层效果,只需要构建HTML结构,CSS3直接调用,当然也可以和js结合一起使用。
perfundo是一款纯CSS3 lightbox插件。使用它可以轻松创建单张或多张图片的弹出lightbox层效果,只需要构建HTML结构,CSS3直接调用,当然也可以和js结合一起使用。
使用方法
HTML结构
在页面中引入perfundo-icons.css文件。
<link href="dist/perfundo.css" rel="stylesheet">
HTML结构
单张图片的HTML结构如下:
<div class="perfundo">
<style>
#perfundo-single:target:before{background-image:url(large.jpg);}
</style>
<a class="perfundo__link" href="#perfundo-single"> <img src="small.jpg"> </a>
<div id="perfundo-single" class="perfundo__overlay">
<a href="#perfundo-untarget" class="perfundo__close perfundo__control">Close</a>
</div>
</div>
多张图片的HTML结构如下:
<div class="perfundo">
<style>#perfundo-img1:target:before{background-image:url(1.jpg);}</style>
<a class="perfundo__link" href="#perfundo-img1">
<img src="1.jpg">
</a>
<div id="perfundo-img1" class="perfundo__overlay">
<a href="#perfundo-untarget" class="perfundo__close perfundo__control">Close</a>
<a class="perfundo__next perfundo__control" href="#perfundo-img2">Next</a>
</div>
</div>
<div class="perfundo">
<style>#perfundo-img2:target:before{background-image:url(2.jpg);}</style>
<a class="perfundo__link" href="#perfundo-img2">
<img src="2.jpg">
</a>
<div id="perfundo-img2" class="perfundo__overlay">
<a href="#perfundo-untarget" class="perfundo__close perfundo__control">Close</a>
<a class="perfundo__next perfundo__control" href="#perfundo-img3">Next</a>
<a class="perfundo__prev perfundo__control" href="#perfundo-img1">Prev</a>
</div>
</div>
<div class="perfundo">
<style>#perfundo-img3:target:before{background-image:url(3.jpg);}</style>
<a class="perfundo__link" href="#perfundo-img3">
<img src="3.jpg">
</a>
<div id="perfundo-img3" class="perfundo__overlay">
<a href="#perfundo-untarget" class="perfundo__close perfundo__control">Close</a>
<a class="perfundo__prev perfundo__control" href="#perfundo-img2">Prev</a>
</div>
</div>
结合JS的用法
你也可以结合js一起使用。
<!-- Put this inside the <head> section of your HTML. -->
<link rel="stylesheet" href="perfundo.min.css">
<!-- Put this before the closing </body> tag (optionally!). -->
<script src="perfundo.min.js"></script>
<script>
perfundo('.perfundo');
</script>
您还可以到Github上了解更多有关该效果的使用情况: https://github.com/maoberlehner/perfundo
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
信息论、推理与学习算法
麦凯 / 高等教育出版社 / 2006-7 / 59.00元
本书是英国剑桥大学卡文迪许实验室的著名学者David J.C.MacKay博士总结多年教学经验和科研成果,于2003年推出的一部力作。本书作者不仅透彻地论述了传统信息论的内容和最新编码算法,而且以高度的学科驾驭能力,匠心独具地在一个统一框架下讨论了贝叶斯数据建模、蒙特卡罗方法、聚类算法、神经网络等属于机器学习和推理领域的主题,从而很好地将诸多学科的技术内涵融会贯通。本书注重理论与实际的结合,内容组......一起来看看 《信息论、推理与学习算法》 这本书的介绍吧!