Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div style="text-align:center">  
    <h1>Image 1(jpg):</h1>

  <img class="light-zoom" src="http://up.0se.ir/uploads/1863642d48bf49bccf6ca51a066f663b72cd5300.jpg">
  <h1>Image 2(gif):</h1>
  
  <img class="light-zoom" src="https://media.giphy.com/media/ZqlvCTNHpqrio/giphy.gif">
</div>
              
            
!

CSS

              
                #glass {
    position: absolute;
    border-radius: 50%;
    box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.85), 0 0 7px 7px rgba(0, 0, 0, 0.25), inset 0 0 40px 2px rgba(0, 0, 0, 0.25);
    display: none;
    background-repeat: no-repeat;
    background-color: rgba(0,0,0,.6);
}
              
            
!

JS

              
                /*
 Author: Jafar Akhondali
 Release year: 2016
 Title:	Light-Zoom JQuery plugin that use pure css to zoom on images, this enables you to zoom without loading bigger image and zoom even on gif images !
 https://github.com/JafarAkhondali/lightzoom
 */
$.fn.lightzoom=function(a){a=$.extend({zoomPower:3,glassSize:175},a);var l=a.glassSize/2,m=a.glassSize/4,n=a.zoomPower;$("body").append('<div id="glass"></div>');$("html > head").append($("<style> #glass{width: "+a.glassSize+"px; height: "+a.glassSize+"px;}</style>"));var k;$("#glass").mousemove(function(a){var c=this.targ;a.target=c;k(a,c)});this.mousemove(function(a){k(a,this)});k=function(a,c){document.getElementById("glass").targ=c;var d=a.pageX,e=a.pageY,g=c.offsetWidth,h=c.offsetHeight,b=$(c).offset(),
f=b.left,b=b.top;d>f&&d<f+g&&b<e&&b+h>e?(offsetXfixer=(d-f-g/2)/(g/2)*m,offsetYfixer=(e-b-h/2)/(h/2)*m,f=(d-f+offsetXfixer)/g*100,b=(e-b+offsetYfixer)/h*100,e-=l,d-=l,$("#glass").css({top:e,left:d,"background-image":" url('"+c.src+"')","background-size":g*n+"px "+h*n+"px","background-position":f+"% "+b+"%",display:"inline-block"}),$("body").css("cursor","none")):($("#glass").css("display","none"),$("body").css("cursor","default"))};return this};


    $(document).ready(function () {
        $('img.light-zoom').lightzoom({
            zoomPower   : 3,    //Default
            glassSize   : 180,  //Default
        });
    });
              
            
!
999px

Console