SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
Thread: getElementById click in firefox
-
Apr 8, 2007, 09:05 #1
- Join Date
- Jan 2005
- Location
- Tennessee
- Posts
- 43
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
getElementById click in firefox
Does anyone know how i can get the getElementById().click() to work in Firefox? It works ok in IE6 but not FF. I've herd that the click() event is not supported by FF. Is there any way to fix it?
Here is my code:
Code:onMouseOver="parent.Switch.document.getElementById('DownON').click()"
Any help would be great!
David
-
Apr 8, 2007, 11:55 #2
- Join Date
- Jan 2005
- Location
- Too far up north
- Posts
- 1,566
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
click is supported for buttons in Firefox. The following works fine.
Code:<input type="button" id="btn" onclick="alert('clicked');"> <script> document.getElementById("btn").click(); </script>
-
Apr 8, 2007, 14:32 #3
- Join Date
- Jan 2005
- Location
- Tennessee
- Posts
- 43
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The button is inside the iframe on the other page. The buttons are inside page2.html and the OnMouseOver is on the page1.html. So its sending the "click" to the buttons on page2 so that it will scroll the text on page2 when the user holds their mouse over the image on page1.
Hope that helps...
David
-
Apr 8, 2007, 14:36 #4
- Join Date
- Jan 2005
- Location
- Too far up north
- Posts
- 1,566
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What error do you get in the JavaScript console in Firefox?
-
Apr 8, 2007, 14:58 #5
- Join Date
- Jan 2005
- Location
- Tennessee
- Posts
- 43
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
The error when i have my mouse over it says:
Code:parent.Switch has no properties
-
Apr 8, 2007, 15:01 #6
- Join Date
- Jan 2005
- Location
- Too far up north
- Posts
- 1,566
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
What is Switch?
-
Apr 8, 2007, 15:06 #7
- Join Date
- Jan 2005
- Location
- Tennessee
- Posts
- 43
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
There is an iframe on the page called "Switch".
Code:<iframe id="Switch" src="MiddlePage.html" width=615 height=337 marginwidth=0 marginheight=0 frameborder=0 scrolling=no></iframe>
Code:<a href="#null" onMouseOver="parent.Switch.document.getElementById('DownON').onclick()" onMouseOut="parent.Switch.document.getElementById('DownOFF').onclick()"><img src="images/NK2K7off_23.jpg" alt="" width="19" height="74" border="0"></a>
Code:<input type="button" id="downON" name="downON" onclick="scroll(-4)" /><input type="button" id="DownOFF" name="DownOFF" onclick="noScroll()" />
-
Apr 8, 2007, 16:39 #8
- Join Date
- Jan 2005
- Location
- Tennessee
- Posts
- 43
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Anyone?
David
Bookmarks