Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#plus').click(
- function( event ){
- var scale = 150/100;
- var pos = $('#Container img').offset();
- var clickX = event.pageX - pos.left;
- var clickY = event.pageY - pos.top;
- var container = $('#Container img').parent().get(0);
- $('#Container img').css({
- width: this.width*scale,
- height: this.height*scale
- });
- container.scrollLeft = ($(container).width() / -2 ) + clickX * scale;
- container.scrollTop = ($(container).height() / -2 ) + clickY * scale;
- }
- );
- $('#minus').click(
- function( event ){
- var scale = 100/150;
- var pos = $('#Container img').offset();
- var clickX = event.pageX - pos.left;
- var clickY = event.pageY - pos.top;
- var container = $('#Container img').parent().get(0);
- $('#Container img').css({
- width: this.width*scale,
- height: this.height*scale
- });
- container.scrollLeft = ($(container).width() / -2 ) + clickX * scale;
- container.scrollTop = ($(container).height() / -2 ) + clickY * scale;
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement