最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do you prevent firefox from zooming in when pressing ctrl and +? - Stack Overflow

programmeradmin1浏览0评论

I am trying to use the ctrl and + bination within firefox for a different action for our web application. How could I prevent firefox from zooming when our web application is listening for this event? I do not want to change a setting within firefox, but would like the code to do this somehow. Any suggestions?

I am trying to use the ctrl and + bination within firefox for a different action for our web application. How could I prevent firefox from zooming when our web application is listening for this event? I do not want to change a setting within firefox, but would like the code to do this somehow. Any suggestions?

Share Improve this question asked Oct 22, 2010 at 21:55 AndrewAndrew 111 silver badge2 bronze badges 0
Add a ment  | 

3 Answers 3

Reset to default 10

I don't think you can overwrite application shortcuts with website code. Imagine a site overwriting alt + tab, and suddenly you wouldn't be able to tab out of your browser window anymore. It is possible with some plugins, but that depends on the browser you're using.

Instead, use something that isn't a default keyboard shortcut to prevent other users from having the same problems. Everyone expects and counts on ctrl and +- to change their zoom level; overwriting this simply isn't a good idea usability-wise.

You could try Flash. Flash tends to gobble up a lot of shortcut keys, including Ctrl+T (new tab) which drives me mad all the time.

According to this resource http://www.arraystudio./as-workshop/disable-ctrl-n-and-other-ctrl-key-binations-in-javascript.html, you should be able to prevent any control keys.

I have used similar techniques, by catching all events on the body tag, and if they are the F keys, then returning a false to veto.

发布评论

评论列表(0)

  1. 暂无评论