Zoom in/out events in jQuery -


i want function show alert on zoom in window saying "you zoomed in" , on zoom out saying "you zoomed out", searched function lot of time every time search "zooming window event" , that's not i'm looking for.

srceen.width fixed value window.innerwidth value change per zoom effect. please try below code:

 $(window).resize(function() {        if(screen.width == window.innerwidth){            alert("you on normal page 100% zoom");        } else if(screen.width > window.innerwidth){            alert("you have zoomed in page i.e more 100%");        } else {            alert("you have zoomed out i.e less 100%")        }     }); 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -