Home > Article > Web Front-end > Ctrl left-click to open a new window. How to implement it by left-clicking directly to expand? _html/css_WEB-ITnose
http://cloud.feedly.com
Features on this website. This effect will occur when you click on the title of the news. This website is blocked, so you need to use a proxy.
Right-clicking and opening a new window has the same effect as Ctrl-left-clicking.
I looked at the code and couldn’t understand it.
I can’t find the effect you mentioned, take a screenshot and have a look
Just use the crtlKey to determine the click time, as follows
$("#divTest").click(function(e) { if (e.shiftKey) { alert("Shift + Click"); } else if (e.ctrlKey) { alert("Crtl + Click"); } else if (e.altKey) { alert("Alt + Click"); } else { alert("Click"); } });
Determine the click time crtlKey is enough, as follows
$("#divTest").click(function(e) { if (e.shiftKey) { alert("Shift + Click"); } else if (e.ctrlKey) { alert("Crtl + Click"); } else if (e.altKey) { alert("Alt + Click"); } else { alert("Click"); } });
Right-clicking a link to open a new window (new tab) is a browser event. It depends on how each browser handles it. crtl click uses javascript to open a new page. Theoretically the effect should be the same.
What’s the difference? Didn’t notice much