JQuery Image Comparison Plugin code:
1.index.html:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>JQuery Image Comparison Plugin</title> <link rel="stylesheet" type="text/css" href="style.css"> <link rel="stylesheet" type="text/css" href="twentytwenty.css"> <script src="https://code.jquery.com/jquery-3.6.0.js"></script> <script src="jquery.event.move.js"></script> <script src="jquery.twentytwenty.js"></script> <script type="text/javascript"> $(function(){ $(".box[data-orientation!='vertical']").twentytwenty({default_offset_pct:0.1}); }) </script> </head> <body> <div class="box"> <img src="image1.jpg"> <img src="image3.jpg"> </div> </body> </html>
2.style.css:
body { margin: 0; padding: 0; font-family: Verdana, Geneva, Tahoma, sans-serif; }