cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="magnify" 
	data-scale="7" 
	data-magnified-zone=".mag_zone" 
	data-containment=".drag_zone"
	data-scale-glass="true">
		<div class="mag_zone">
			<!-- this is where the magnifyed elements get placed -->
		</div>
		<div class="drag_zone">
			<div class="magnify_glass">
				<!-- this is the object you drag around -->
			</div>
			
			<div class = "element_to_magnify" >
				<!-- anything in here gets copied and scaled to the mag_zone -->
				<a target="_blank" href="https://github.com/fonstok/jfMagnify">https://github.com/fonstok/jfMagnify</a>
				<img class="imgToCSS" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/367305/IMG_2209.jpg" draggable="false"/>
			</div>
		</div>
	</div>
      
            
          
!
            
              * {
    box-sizing:border-box;
    margin-top: 0px;
}
body, html {
    width:100%;
    height:100%;
}
body {
    font-family:Sans-Serif;
    padding: 0px;
    background-color: #333;
    color: #FFF;
    margin:0px;
    padding: 0px;
}
.magnify {
    top:0px;
    right:0px;
    left:0px;
    bottom:0px;
    z-index: 20;
    background-color:blue;
    position: absolute;
}
 
.magnify img {
    display:block;
}
 
.drag_zone {
    position: absolute;
    width: 300px;
    height:200px;
    bottom:10px;
    right:10px;
    z-index:800;
    border:solid #fff 1px;  
}
 
.element_to_magnify {
    position: absolute;
    width:100%;
    height:100%;
    right:0px;
    top:0px;
    overflow: hidden;
}
.element_to_magnify  a {
  display:block;
  position:absolute;
  top:5px;
  right:5px;
  background-color:rgba(200, 200, 200, .25);
  padding:4px;
  font-size:10px;
  color:#fff;
}
.element_to_magnify img{
    width: 100%;
    height: auto;
}
.magnified_element {
    /* so you can contol the magnified stuff*/
}
 
.mag_zone {
    position: absolute;
    left: 0px;
    top:0px;
    right:0px;
    bottom:0px;
    z-index: 290;
    overflow:hidden;
    background-color: #999;
}
 
.magnify_glass {
    z-index: 300;
    position: absolute;
    background:none;
    top:0px;
    left:0px;
    width: 200px;
    height: 200px;
    border: 4px solid #CCC;
    background-color: rgba(200,200,200,.5);
    cursor: move;
}

            
          
!
            
              $('.imgToCSS').jfImgToCSS({});// jfImgToCSS you don't need this I just like to use this method to work with images because it's neater. More on this here: https://codepen.io/fonstok/pen/WXpJxw

// the jfMagnify plugin and other demo files can be found
// https://github.com/fonstok/jfMagnify
$(".magnify").jfMagnify();



			
            
          
!
999px
Loading ..................

Console