disable tr onclick event

S

SomeGei

Hey guys....

i have a really big table... and the <tr> tags have onclick/onmouseover
events that highlight a row when you drag your mouse over it, and open a
popup window when you click anywhere in the row...

if i however have some text in the row that has an href link attached to it,
when i click on the link it will go to the href url AND open the popup
window...

is there any way to stop the popup window from opening when i click a
certain link within a row?
 
J

Jukka K. Korpela

SomeGei said:
i have a really big table...

What help do you need for solving that problem?
and the <tr> tags have
onclick/onmouseover events that highlight a row when you drag your
mouse over it, and open a popup window when you click anywhere in the
row...

Oh. It sounds like you need lots of help.
if i however have some text in the row that has an href link attached
to it, when i click on the link it will go to the href url AND open
the popup window...

is there any way to stop the popup window from opening when i click a
certain link within a row?

This is about event bubbling, not really about HTML - HTML specifications
leave the meaning of event attributes rather vague.

But since I'm in a techie mood this evening, here's a quick and
unfriendly answer: Add a variable into your JavaScript code:

<script type="text/javascript">
var popup = true;
</script>

and change the code for the popup stuff so that it is conditional on that
variable, and sets it if it were unset:

if(popup) { ... (what you have now); } else { popup=true; }

Finally, use

<a href="..." onclick="popup=false;">

in each link.
 
S

SomeGei

yep... that does it...

i actually figured that exact same thing out about 5 minutes before you
posted this.. but thanks for the reply
 
J

Jukka K. Korpela

SomeGei said:
yep... that does it...

For some values of "it". Thank you for telling that you fail to read
replies comprehensively, by quoting them comprehensively below your own
text. To indicate that you don't want any useful replies, please keep
using that style and a forged From field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top