Deaktivieren Sie Popup auf einem bestimmten Element

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Deaktivieren Sie Popup auf einem bestimmten Element

by Anonymous » 05 Apr 2025, 13:13

i have a popup on my site which opens when user clicks anywhere on page
I wan to disable it from opening when user clicks on a specific element (in this case a DIV which has ID and CLASS)
(clicking on this specific DIV, will open a direct link to another page on site)
Here is how it is:

Code: Select all


 [url=LINK2]LINK2[/url] 

...... page content
(function(){const urlToOpen = "my_site/LINK1";document.addEventListener('click', function(event) {event.preventDefault();window.open(urlToOpen, '_blank');}});})();

Ich möchte das Öffnungslink 1 deaktivieren, wenn der Benutzer mit CALSS1 oder DIV mit ID1

Top