Closed Thread Icon

Topic awaiting preservation: 2 onClick events possible? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8742" title="Pages that link to Topic awaiting preservation: 2 onClick events possible? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: 2 onClick events possible? <span class="small">(Page 1 of 1)</span>\

 
JKMabry
Maniac (V) Inmate

From: out of a sleepy funk
Insane since: Aug 2000

posted posted 07-03-2003 20:02

I'm having a problem with 2 onClick events. I have maX's focus dots killer:

code:
function diedotsdie() {
for (i = 0; i < document.links.length; i++) {
document.links[i].onclick = document.links[i].blur;
}
}



and I'm also wanting to use popup links like so:

code:
<a href="foo.html" onclick="window.open(this.href, 'popupwindow', 'width=600,height=400,scrollbars,resizable'); return false;">LINK TEXT</a>



but the links won't open in a new window cuz onclick is taken by the blurring action. I changed the event handler in the focuskiller to onFocus and this is working fine now but it led me to wonder about having 2 onClick events, is it possible?

Jason

dunno what the itlaics are all about there...

[This message has been edited by JKMabry (edited 07-03-2003).]

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 07-03-2003 20:33

Sure just call them both

code:
onClick="window.open(this.href, 'popupwindow', 'width=600,height=400,scrollbars,resizable'); diedotsdie(); return false;"



Sometimes for readability and sanity it helps to wrap them in a function

code:
function popper(link) {
diedotsdie();
window.open(link, 'popupwindow', 'width=600,height=400,scrollbars,resizable');
return false;

}



and call it like so
onClick="return popper(this.href);"






.:[ Never resist a perfect moment ]:.

JKMabry
Maniac (V) Inmate

From: out of a sleepy funk
Insane since: Aug 2000

posted posted 07-03-2003 21:49

gah, I sorta knew that about callin them both, bleh.

thanks man, you've given me a little knowledge, a dangerous thing =)

Jason

« BackwardsOnwards »

Show Forum Drop Down Menu