This article describes the method of using js to implement mouse suspension to add borders to images. Share it for your reference. The specific implementation method is as follows:
html code:
<div> <a href=""> <img src="images/11.jpg" /> </a><a href=""> <img src="images/11.jpg" /> </a><a href=""> <img src="images/11.jpg" /> </a><a href=""> <img src="images/11.jpg" /> </a> </div>
js code:
<script src="js/jquery-1.9.1.min.js" type="text/javascript"></script> <script src="js/jquery.insetborder.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { //border $(".Tsl a.a1").borderEffect(); $(".a1").borderEffect(); $(".Tsl a.a2").borderEffect({ borderColor: '#e80484' }); $(".Tsl a.a3").borderEffect({ borderColor: '#7b7b7b', speed: 300, borderWidth: 10 }); }); </script>css code:
.Tsl a{background:url(images/download.png) no-repeat -10px 20px #fff;} .Tsl{width:952px;overflow:hidden;} .Tsl a{float:left; width:234px;height:368px;margin:0 19px 17px 0;font-size:0;overflow:hidden;}I hope this article will be helpful to everyone's JavaScript programming.