简体   繁体   中英

Browser's zoom-in and zoom-out function calling

是否可以通过浏览器的放大和缩小来触发 javascript 功能?

Yes friends.... Found the solution....

window.onresize = resize;
function resize() {
   alert("Windows is resized...");
}

I hope this will be helpful for you.

OR

This will help you Get Height Width on zoom-in & zoom-out browser

(window.devicePixelRatio*100).toFixed(0) + '%';

you are not triggered the browser's zoom in/out functions but capture the event. This code helps you to capture the browser's current tab zoom in / zoom out percentage ratio.

run the code : chrome -> console -> create live expression -> paste it & enter.

use chrome zoom in/ out the tab

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM