amit
amit

Reputation: 10261

jquery animate

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?

Upvotes: 1

Views: 4339

Answers (3)

Shawn31313
Shawn31313

Reputation: 6052

Yes just simple do:

$('#zoom').animate({'height' : '100%'},600)

That will work.

Upvotes: 2

Sinan
Sinan

Reputation: 11563

as TheVillageIdiot says, but little bit different syntax:

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

hope it helps.

Upvotes: 1

TheVillageIdiot
TheVillageIdiot

Reputation: 40527

  $("#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.

Upvotes: 4

Related Questions