Where to add JavaScript code?
-
Regarding your post in the FAQ section:
“How to open external links in a new popup window?”Could you please tell me where I should add the JavaScript code. Thank you.
By adding this JavaScript code to your site:
jQuery(function ($) {
$(‘a[data-wpel-link=”external”]’).click(function (e) {
// open link in popup window
window.open($(this).attr(‘href’), ‘_blank’, ‘width=800, height=600’);// stop default and other behaviour
e.preventDefault();
e.stopImmediatePropagation();
});
});
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Where to add JavaScript code?’ is closed to new replies.