Link directly opens anyway when in Navbar
-
Hey Curtis,
first of all, Im very pleased with your work. It does exactly what I want it to do, and I like that there are so many options for fine tuning it.
Keep up the good work!I have only one problem: I want to add a Link to the navbar, and it seems like at this point the way wordpress handles links in the navbar is interrupting with your Plugin.
What happens is that the pop up shows up correctly but WordPress opens the link anyway.
I already tried to figure out why, and it seems like wordpress is applying its own onclick events to all
<a>
elements in the navbar which changes the window.location and are handled right before the events of your Plugin:function() { if ($(this).attr('target') !== '_blank') { window.location = $(this).attr('href'); } else { var win = window.open($(this).attr('href'), '_blank'); win.focus(); } }
If you want to take a look by yourself, you can try the “SHOP” Menu-Item in the Navbar of my Website.
Do you think there is a nice solution to turn off this behavior so that the link will not be opened again until you have agreed to it?
At the moment I can only think of trying to reset every onclick function before the exit notifier is applied but this is somehow a hacky solution :/
Thanks in advance!
The page I need help with: [log in to see the link]
- The topic ‘Link directly opens anyway when in Navbar’ is closed to new replies.