How to simulate as if the user pressed Ctrl plus or minus plus or minus using javascript (jQuery)?

Is this possible if I click on the anchor link for the simulation, as if I had pressed the Ctrl+ keys on the keyboard (or equivalent on Mac)? if yes, could you show me how to do this, please?

sort of

 <a href="#" onclick="simulateCtrlKeyPlus();return false;">Ctrl+</a> 
+4
source share
3 answers

If you just want to simulate the behavior of the CTRL + Mousewheel Zoom function, you can use CSS3-Transitions. Good jQuery plugin for this jquery Transit .

Example:

 $('a.ctrlplus').click(function() { $('body').transition({ scale: ($('body').css('scale')+0.1) }); }); 

I don’t know if it works in all browsers.

+2
source

I'm sure you need to access this level of the browser API, as not all browsers have this feature or do it the same way.

+2
source

I can’t understand what you are going to achieve, but here is a plugin that has simplified the work with keyboard keys.

Here is an example

 shortcut.add("Ctrl+Shift+X",function() { alert("You have pressed Ctrl+____"); }); 

Hope this helps you.

+1
source

All Articles