-3

I am having difficulties to code a simple jquery enlarge image feature on a image however i do not want plugins. So when you click on a image it pops up and enlarges the image size and when you click on "x" it closes the enlarge image.

user929153
  • 475
  • 2
  • 11
  • 25

2 Answers2

0

Just us www.fancybox.net. If you really not want to use any plugin you will still endup with the samecode as one plugin.

Do something like this if you really want not to use a plugin.

$(document).ready(function () {
   $("img").toggle(function () {
        var width = $(this).attr("width");
        var height = $(this).attr("height");
        // Add function for displaying
    }, function () {
      // Add function for closing
    })
})
Simon Edström
  • 6,461
  • 7
  • 32
  • 52
0

You could use zoom css for this (but not supported in all browsers yet)

$('#myImage').css({zoom: '200%'})

terjeto
  • 386
  • 2
  • 13