disable tr onclick event

Discussion in 'HTML' started by SomeGei, Aug 29, 2004.

  1. SomeGei

    SomeGei Guest

    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?
    SomeGei, Aug 29, 2004
    #1
    1. Advertising

  2. "SomeGei" <> wrote:

    > 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.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Aug 29, 2004
    #2
    1. Advertising

  3. SomeGei

    SomeGei Guest

    yep... that does it...

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



    "Jukka K. Korpela" <> wrote in message
    news:Xns9554E48B67771jkorpelacstutfi@193.229.0.31...
    > "SomeGei" <> wrote:
    >
    >> 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.
    >
    > --
    > Yucca, http://www.cs.tut.fi/~jkorpela/
    > Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    >
    >
    SomeGei, Aug 29, 2004
    #3
  4. "SomeGei" <> wrote:

    > 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.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Aug 29, 2004
    #4
  5. SomeGei

    SomeGei Guest

    wow.. you are one odd character.

    dont get out much do you?


    "Jukka K. Korpela" <> wrote in message
    news:Xns9554EBE98C9FBjkorpelacstutfi@193.229.0.31...
    > "SomeGei" <> wrote:
    >
    >> 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.
    >
    > --
    > Yucca, http://www.cs.tut.fi/~jkorpela/
    > Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    >
    >
    SomeGei, Aug 29, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JerryG
    Replies:
    0
    Views:
    423
    JerryG
    Dec 20, 2005
  2. MEM

    Disable/enable onclick event

    MEM, Oct 30, 2003, in forum: Javascript
    Replies:
    1
    Views:
    109
    Rick Measham
    Oct 30, 2003
  3. Barton
    Replies:
    2
    Views:
    193
    Lasse Reichstein Nielsen
    Dec 30, 2003
  4. SomeGei

    Disable tr onclick event...

    SomeGei, Aug 29, 2004, in forum: Javascript
    Replies:
    1
    Views:
    138
    Michael Winter
    Aug 29, 2004
  5. Disable TR onclick event

    , Jun 14, 2006, in forum: Javascript
    Replies:
    14
    Views:
    210
Loading...

Share This Page