Marlon Creative
Marlon Creative

Reputation: 3846

Help with jQuery 'zoom' script

I'm using this script on my site - http://www.suuronen.org/esa-matti/projects/panfullsize/

Got it all working fine, only problem is that it always defaults to the zoomed image when you load a page. I'd rather it showed the scaled down image first, and then zoomed when requested.

Anyone know how I can fix it?

Cheers

Sam

Upvotes: 1

Views: 252

Answers (2)

esamatti
esamatti

Reputation: 18983

Just don't call the panFullSize until you need to pan.

$(document).ready( function() {

    var $pic = $("img#mypic");

    $("a#zoom").toggle(function(){
            $pic.panFullSize(700, 450);.
        },
        function(){
            $pic.normalView();
        }
    );

});

Or you can use the new callback parameter:

$pic.panFullSize(700, 450, function(){
    $pic.normalView();  
});.

Upvotes: 1

Funky Dude
Funky Dude

Reputation: 3967

try calling this function after everything

$('#yourpan').normalView(); 

Upvotes: 1

Related Questions