954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Javascript to trigger key combination

I need javascript to trigger the combination of ctrl + minus. Is it possible. I need this because the design of the webpage I'm working on is looking much better at 83 % zoom which couldn't be achieved by CSS zoom property in mozzila firefox.

george61
Junior Poster in Training
59 posts since Jul 2010
Reputation Points: 10
Solved Threads: 6
 

Why you want to do things that is not stable at all?
If some how you achieved this, what if user press ctrl+ again. Then you will ask how to restrict this.

You can not restrict user. They will some how break all your twiky walls.

I would suggest you do all the visual stuff in css itself. That will make your page view more manageable.

Luckychap
Posting Pro in Training
444 posts since Aug 2006
Reputation Points: 83
Solved Threads: 61
 

You can achieve that by adding a listener to the keyboard (attachEvent() for IE and addEventListener() for FF and some others); however, as Luckychap suggested, I don't think it is a good idea to do so. This is the design problem, and it should not be designed the way it is now. Adding more stuff on top of it to solve the issue would give you more and more headache later on...

Taywin
Posting Virtuoso
1,727 posts since Apr 2010
Reputation Points: 229
Solved Threads: 239
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: