SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Apr 5, 2007, 01:09 #1
- Join Date
- Aug 2003
- Location
- Nr Leeds
- Posts
- 161
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Window.ONCLICK or Window.ONLOAD ?
Could you please help me out, please see the code below. At present, the window attributes are loaded from the popup.js file.
_________________________________________________
<script language="JavaScript" src="popup.js">
</script>
<script>
window.onload=function(){
new popUp(200, 100, 600, 550, "Brad", "CONTENT" "0066ff", "white", "#FFFFFF", "0066ff", "666666", true, true, true, true, false);
}
</script>
<a href="javascript:showbox('Brad')">LINK TO POPUP</a>
_________________________________________________
- The :showbox relates to the attributes in the .js file.
At present the window loads fine when the page is loaded, but i ONLY want it to be displayed when the link is clicked.
I have tryed changing window.onload to onclick but it does not seam to work. I know its simple but cannot figure it out.
Thanks
-
Apr 5, 2007, 01:50 #2
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Code:<script type="text/javascript" src="popup.js"></script> <script type="text/javascript"> function showPopup() { showbox("Brad"); new popUp(200, 100, 600, 550, "Brad", "CONTENT" "0066ff", "white", "#FFFFFF", "0066ff", "666666", true, true, true, true, false); } </script>
HTML Code:<a href="#" onclick="showPopup(); return false;">LINK TO POPUP</a>
Birnam wood is come to Dunsinane
-
Apr 5, 2007, 02:34 #3
- Join Date
- Aug 2003
- Location
- Nr Leeds
- Posts
- 161
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi Mate... Thank-You for the response, but it does not seam to work...
Has anyone else got any suggestions ?
-
Apr 5, 2007, 03:48 #4
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What doesn't work? What does showbox() and popUp() do? It could be something in either of those two functions that causes the problems ... whatever they are.
Birnam wood is come to Dunsinane
-
Apr 5, 2007, 03:53 #5
- Join Date
- Aug 2003
- Location
- Nr Leeds
- Posts
- 161
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Please find attached the popup.js file.
It was a script i got from the internet. The version i posted works fine displaying a popup when the page loads, and making a link to re-open the popup if it is closed.
What i want it to do is to ONLY open the popup when the link is clicked. I want to keep it displaying in the window made from the Javascript file as it looks and suites the site really well.
Thanks
-
Apr 11, 2007, 00:10 #6
- Join Date
- Aug 2003
- Location
- Nr Leeds
- Posts
- 161
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Bump...
Bookmarks