473,324 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Disabling onclick (using Spry)

I want to disable the onclick for a <div>. In onclick I am using
Spry.Effect.AppearFade(...). Any suggestions on how to disable onclick
after the first initial click from the user?

Dec 21 '06 #1
6 2581
"Steve" <s.*******@gmail.comwrote in message
news:11*********************@42g2000cwt.googlegrou ps.com...
>I want to disable the onclick for a <div>. In onclick I am using
Spry.Effect.AppearFade(...). Any suggestions on how to disable onclick
after the first initial click from the user?
If you were somehow reloading the page you could use onclick="return false;". As this is
a DHTML library I assume that is not the case.

You could then use form fields with an event handler and disable them after their initial
click.

-Lost
Dec 21 '06 #2
Steve said the following on 12/21/2006 4:03 PM:
I want to disable the onclick for a <div>. In onclick I am using
Spry.Effect.AppearFade(...). Any suggestions on how to disable onclick
after the first initial click from the user?
onclick="someFunction();this.onclick = null"

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 21 '06 #3
SWEET! Thanks Randy, that did it!

Randy Webb wrote:
Steve said the following on 12/21/2006 4:03 PM:
I want to disable the onclick for a <div>. In onclick I am using
Spry.Effect.AppearFade(...). Any suggestions on how to disable onclick
after the first initial click from the user?

onclick="someFunction();this.onclick = null"

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 21 '06 #4
"Randy Webb" <Hi************@aol.comwrote in message
news:g4********************@telcove.net...
Steve said the following on 12/21/2006 4:03 PM:
>I want to disable the onclick for a <div>. In onclick I am using
Spry.Effect.AppearFade(...). Any suggestions on how to disable onclick
after the first initial click from the user?

onclick="someFunction();this.onclick = null"
Heh. Well, Steve said "disable" not "kill".

Offhand, is there a way to revive the event handler (after nullifying it)?

Thanks.

-Lost

Dec 21 '06 #5
-Lost said the following on 12/21/2006 6:51 PM:
"Randy Webb" <Hi************@aol.comwrote in message
news:g4********************@telcove.net...
>Steve said the following on 12/21/2006 4:03 PM:
>>I want to disable the onclick for a <div>. In onclick I am using
Spry.Effect.AppearFade(...). Any suggestions on how to disable onclick
after the first initial click from the user?
onclick="someFunction();this.onclick = null"

Heh. Well, Steve said "disable" not "kill".
I did both :)
Offhand, is there a way to revive the event handler (after nullifying it)?
Store a reference to it and then set it back.

onclick="someFunction();this.oldOnClick=this.oncli ck;this.onclick=null"

And then some way to restore it:

document.getElementById('thatElement').onclick=doc ument.getElementById('thatElement').oldOnClick

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 22 '06 #6
"Randy Webb" <Hi************@aol.comwrote in message
news:er********************@telcove.net...
-Lost said the following on 12/21/2006 6:51 PM:
>"Randy Webb" <Hi************@aol.comwrote in message
news:g4********************@telcove.net...
>>Steve said the following on 12/21/2006 4:03 PM:
I want to disable the onclick for a <div>. In onclick I am using
Spry.Effect.AppearFade(...). Any suggestions on how to disable onclick
after the first initial click from the user?

onclick="someFunction();this.onclick = null"

Heh. Well, Steve said "disable" not "kill".

I did both :)
>Offhand, is there a way to revive the event handler (after nullifying it)?

Store a reference to it and then set it back.

onclick="someFunction();this.oldOnClick=this.oncli ck;this.onclick=null"

And then some way to restore it:

document.getElementById('thatElement').onclick=doc ument.getElementById('thatElement').oldOnClick
Awesome. Thanks.

Be well.

-Lost
Dec 22 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: inonzuk | last post by:
Hi everyone, I'm new to javascript and have the following problem: I have two image buttons: 1) <td><a href="http://localhost/gamerules.php" target="mainwindow"><img onMouseOver="return...
2
by: Jeelz | last post by:
Hi Guyz, Would appriciate any tip on disabling an ASP.NET LinkButton using client sided code like javascript. My Requirement is such that the user should be allowed to click on the link...
4
by: Dan =o\) | last post by:
Hi guys, in the scenario where a user fills in a form, and clicks on a button to Save, there's a period of waiting (the slower the connection between client and server, the longer the delay)...
18
by: seth.m.green | last post by:
<a href="javascript: void(0);" onclick="window.location.href='/foo.bar?one=false&two=true'">Link</a> works like a charm in Firefox. I get NOTHING in IE. but if I replace the javascript: void(0)...
7
by: Varangian | last post by:
Hello I want to disable all the elements which are the childs of a Div element. I tried disabling the div element but it doesn't work... i.e. the child elements were not disabled what shal...
1
by: kebabkongen | last post by:
Hi, I'm working on a JavaScript that is enabling / disabling a select element according to whether a checkbox is selected or not. This works fine in Firefox, but in Internet Explorer (v 6.0.2900)...
2
by: starson | last post by:
Hi there, I am trying to create an index with a hovering menu. I used Dreamweaver insert Spry Menu. I have an index that needs to have an indent after the index number. Something like...
1
by: printline | last post by:
Hello All I'm a newbee to javascript/ajax. I have produced a form, where i want to do some validation on some fields. I have used the spry framework and it works fine. Now, i have a select...
20
by: Geoff Cox | last post by:
Hello, I am not at clear how to tackle this one. Say the note middle C is played, just once. Then when the user clicks on a play image a series of notes are played starting with middle C...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.