0
// CENTER ZOOM IMAGE X+Y zoom_width = $('#container #main .wrap #zoom img').width(); zoom_height = $('#container #main .wrap #zoom img').height(); var zoom_divheight = $('#container #main .wrap #zoom').height(); $('#container #main .wrap #zoom img').css('left', '50%'); $('#container #main .wrap #zoom img').css('right', '50%'); $('#container #main .wrap #zoom img').css('marginTop', ''+((zoom_divheight-zoom_height)/2)+'px'); $('#container #main .wrap #zoom img').css('marginLeft', '-'+(zoom_width/2)+'px');
<div id="zoom"> <div class="bg-wrap"> <a href="#" rel="temp/produit-zoom-xxl.jpg"><img src="temp/produit-zoom.jpg" alt="zoom" /></a> </div> </div>
/* PRODUCTS * ZOOM */ #container #main .wrap #zoom { width:570px; height: 600px; float:left; position: relative; } #container #main .wrap #zoom .bg-wrap { width: 100%; height: 100%; background:#FFF; } #container #main .wrap #zoom img { position: absolute; cursor: crosshair; border:1px solid red; }
DATE 25 Oct 2010