Click here to Skip to main content
15,895,833 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to give zoom in zoom out effect on mouse wheel[scroll] when i have click or open an image...
Posted

C#
$(document).ready(function(){
    $('#main').bind('wheel mousewheel', function(e){
        var delta;

        if (e.originalEvent.wheelDelta !== undefined)
            delta = e.originalEvent.wheelDelta;
        else
            delta = e.originalEvent.deltaY * -1;

            if(delta > 0) {
                $("#main").css("width", "+=10");
            }
            else{
                $("#main").css("width", "-=10");
            }
        });
    });

[source code][^]


Plugins:
http://www.jacklmoore.com/wheelzoom/[^]
http://www.jqueryscript.net/zoom/jQuery-Plugin-for-Image-Zoom-In-Out-With-Mousewheel-imgViewer.html[^]


-KR
 
Share this answer
 
Hi there are plenty of Jquery plugins to do that. Please check this one http://www.jacklmoore.com/wheelzoom[^]
 
Share this answer
 
 
Share this answer
 
Thank You so much for your valuable reply...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900