Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
galera estava vendo o tutorial desse site http://thecodeplayer.com/walkthrough/magnifying-glass-for-images-using-jquery-and-css3 eu fiz tudo como esta la,mas so a parte do java(jquery) nao esta pegando! olhem meu codigo:
<html> <head>
<link href="new1.css" rel="stylesheet" type="text/css"/>
<<script type="text/javascript">
$(document).ready(function(){ var native_width = 0. var native_height = 0. //Now the mousemove functionvar image_object = new Image(). image_object.src = $(".small").attr("src"). //This code is wrapped in the.load function which is important.native_width = image_object.width. native_height = image_object.height. }var mx = e.pageX - magnify_offset.left. var my = e.pageY - magnify_offset.top. //Finally the code to fade out the glass if the mouse is outside the container$(".large").fadeIn(100). }$(".large").fadeOut(100). }var rx = Math.round(mx/$(".small").width()*native_width - $(".large").width()/2)*-1. var ry = Math.round(my/$(".small").height()*native_height - $(".large").height()/2)*-1. var bgp = rx + "px " + ry + "px". //Time to move the magnifying glass with the mousevar px = mx - $(".large").width()/2. var py = my - $(".large").height()/2. $(".large").css({left: px, top: py, backgroundPosition: bgp}). }
}
})
})
</script>
</head> <body><img class="small" src="[http://thecodeplayer.com/uploads/media/iphone.jpg](http://thecodeplayer.com/uploads/media/iphone.jpg)" width="200"/> </div> <!-- Lets load up prefixfree to handle CSS3 vendor prefixes --><script src="[http://thecodeplayer.com/uploads/js/jquery-1.7.1.min.js](http://thecodeplayer.com/uploads/js/jquery-1.7.1.min.js)" type="text/javascript"></script> </body> </html>Carregando comentários...