views:

935

answers:

2

i need to use the animate property for a less than usual activity. i am new at jquery so i dont know if this thing works right out of the box for jquery but lets see.

 $('#Zoom').toggle(function() {
      img.removeAttribute("height");
  $("#draggable").draggable();       
     },

the above function zooms into an image by removing the height constraint and displays the image its entire resolution. can i somehow make this transition animate?

+2  A: 
  $("#zoom").animate({'height':'1024px'},{'queue':false,'duration':2000}

But you need to know the height of picture at full resolution to pass to call to animate. you may try passing 100% like this:

  $("#zoom").animate({'height':'100%'},{'queue':false,'duration':2000}

More about jquery animation can be found here.

TheVillageIdiot
A: 

as TheVillageIdiot says, but little bit different syntax:

$("your_image_selector").animate({"height": "100%"}, 400);

hope it helps.

Sinan Y.
PS> 400 is duration in miliseconds...
Sinan Y.