sypa
07-21-2010, 03:56 PM
I am using a lightbox script (which dims the page when clicked and shows a pop up image).
This script is called upon by the user clicking on an imageButton.
I am also trying to close, hide or disable this once it has been clicked on (so it only works once).
My code is below:
< a href="lightbox/images/image-1.jpg" name="alightbox" rel="lightbox" >
< asp:ImageButton ID="ImgBtnWarning" src="lightbox/images/submitCover.gif"
runat="server" border="0"
onClick="ImgBtnWarning_Click"
style="position: relative; top:10px; left: 75px; z-index: 1; display: none;" / >
< / a>
The problem is, when I wrap the < a > tags around my imageButton - the image button code doesn't work (and so fails to activate the onClick event - where I disable this once it has run).
I am probably doing this wrong, but I don't know of another way to get the lightbox to only work once or to disable the ImgBtnWarning from the lightbox.js file.
FURTHER INFO:
Lightbox example here:
http://www.javascriptkit.com/script/script2/backbox/index.shtml
I have tried a JavaScript piece of code to disable the btn once clicked, but this also needs to use href - and I am already using href to open the lightbox image.
This script is called upon by the user clicking on an imageButton.
I am also trying to close, hide or disable this once it has been clicked on (so it only works once).
My code is below:
< a href="lightbox/images/image-1.jpg" name="alightbox" rel="lightbox" >
< asp:ImageButton ID="ImgBtnWarning" src="lightbox/images/submitCover.gif"
runat="server" border="0"
onClick="ImgBtnWarning_Click"
style="position: relative; top:10px; left: 75px; z-index: 1; display: none;" / >
< / a>
The problem is, when I wrap the < a > tags around my imageButton - the image button code doesn't work (and so fails to activate the onClick event - where I disable this once it has run).
I am probably doing this wrong, but I don't know of another way to get the lightbox to only work once or to disable the ImgBtnWarning from the lightbox.js file.
FURTHER INFO:
Lightbox example here:
http://www.javascriptkit.com/script/script2/backbox/index.shtml
I have tried a JavaScript piece of code to disable the btn once clicked, but this also needs to use href - and I am already using href to open the lightbox image.