Home > Web Front-end > JS Tutorial > The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jquery

The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jquery

WBOY
Release: 2016-05-16 15:46:24
Original
1703 people have browsed it

The example in this article describes how the jquery plug-in jquery.The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryafter.js implements dragging the left and right separators to compare images. Share it with everyone for your reference. The details are as follows:

Drag left and right to switch and compare the picture effects. After running the effect, there is a drag bar in the middle of the picture. Drag it left and right to see different effects on the picture. The female model’s face becomes tender. Haha, actually using It is implemented with two background images, which requires the jquery.The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryafter.js plug-in. The small icon when dragging is gone. The path can be set in jquery.The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryafter.js, so I won’t go into details.

The screenshot of the running effect is as follows:

The online demo address is as follows:

http://demo.jb51.net/js/2015/jquery-The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryafter-js-style-codes/

The specific code is as follows:

<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>通过拖拽展示前后图片对比效果的jQuery插件jquery.The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryafter</title>
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="js/jquery.The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryafter-1.3.min.js"></script>
<script type="text/javascript">
$(function(){
  $('#container').The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryAfter({imagePath:'js/'});
  $('#container1').The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryAfter({imagePath:'js/'});
  $('#container2').The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryAfter({imagePath:'js/'});
  $('#container3').The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryAfter({imagePath:'js/'});
  $('#container4').The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryAfter({imagePath:'js/'});
  $('#container5').The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryAfter({imagePath:'js/'});
  $('#container6').The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jqueryAfter({imagePath:'js/'});
});
</script>
 <style> html{display : none ; } </style>
 <script>
 if( self == top ) {
  document.documentElement.style.display = 'block' ; 
 } else {
  top.location = self.location ; 
 }
 </script>
<style type="text/css">
body {
  background: #ccc;
}
#content {
  margin:0 auto;
  width:755px;
}
#container + div.balinks {
<!--margin-left: 200px; -->
}
</style>
</head>
<body>
<div id="content">
<div id="container3">
<div><img alt="The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jquery" src="images/blonde1_The jquery plug-in jquery.beforeafter.js realizes the method of dragging the left and right separators to compare pictures_jquery.jpg"    style="max-width:90%"  style="max-width:90%" /></div>
<div><img alt="after" src="images/blonde1_after.jpg"    style="max-width:90%"  style="max-width:90%" /></div>
</div>
</div>
</body>
</html>
Copy after login

I hope this article will be helpful to everyone’s jquery programming design.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template