Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > JavaScript

Reply
 
LinkBack Thread Tools
Old March 11th, 2008, 07:15 PM   #1
WebForumz Member
 

Join Date: Sep 2005
Location: athens
Age: 27
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 ktsirig is on a distinguished road
bug in Firefox???

Hello,
I have a js function that is triggered with the onclick event. In particular, there is a <tr> in a table that is shown when the user clicks on the "Show" button.

In HTML I have:
Code:
<tr>  <td>
    <img id="myimage" src="css/images/show.png"           onclick="javascript:HideShow('myrow');"/>
   </td>
</tr><tr id="myrow" style="display:none">
      <td>Hello all!
      </td>
</tr>
and the JS part is:

Code:
<script type="text/javascript">
function HideShow(myVar) 
          { 
                if (document.getElementById(myVar).style.display == 'none') 
                { 
                    document.getElementById(myVar).style.display = 'inline'
                } 
                else 
                { 
                    document.getElementById(myVar).style.display = 'none'
                }
          } 
</script>
The function works fine, that is, when the user clicks on the image, the tr appears and then, if the user clicks again, it disappears... BUT all these work perfectly with IE, whereas in Firefox, the contents of the tr appear and disappear when the image is clicked, however, when the user clicks twice, the "Hello world" data disappears, but a blank row remains...And, if you do that again and again, I end up with as much blank rows as the times that I click the button for the data to disappear...

Is this something like a bug? Can I do anything else?
ktsirig is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old March 12th, 2008, 12:34 AM   #2
Reputable Member
 

Join Date: Oct 2006
Location: Southampton
Age: 31
Posts: 356
Blog Entries: 2
Thanks: 2
Thanked 8 Times in 8 Posts
Rep Altering Power: 0 frinkky is on a distinguished road
Re: bug in Firefox???

a
__________________
Web Design Forums
frinkky is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old March 12th, 2008, 05:11 PM   #3
Most Reputable Member
 

Join Date: Feb 2008
Location: In My Own Little World
Age: 16
Posts: 1,345
Blog Entries: 9
Thanks: 2
Thanked 45 Times in 45 Posts
Rep Altering Power: 0 CloudedVision is on a distinguished road
Re: bug in Firefox???

i completely agree with frinkky

i think was frinkky was trying to communicate was that instead of doing

Code:
<img id="myimage" src="css/images/show.png"           onclick="javascript:HideShow('myrow');"/>
you should do

Code:
<a href="#" onclick="javascript:HideShow('myrow');"><img src="css/images/show.png" name="myimage" border="0" id="myimage" /></a>
It worked fine for me with that
__________________
Theron Luhn
CloudedVision is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old March 12th, 2008, 07:47 PM   #4
Reputable Member
 

Join Date: Oct 2006
Location: Southampton
Age: 31
Posts: 356
Blog Entries: 2
Thanks: 2
Thanked 8 Times in 8 Posts
Rep Altering Power: 0 frinkky is on a distinguished road
Re: bug in Firefox???

Very perceptive of you CV

I hadn't actually meant to post on this topic at all.
__________________
Web Design Forums
frinkky is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old March 12th, 2008, 07:55 PM   #5
Most Reputable Member
SuperMember
 

Join Date: Nov 2005
Age: 28
Posts: 1,546
Thanks: 1
Thanked 11 Times in 11 Posts
Rep Altering Power: 0 saltedm8 will become famous soon enough saltedm8 will become famous soon enough
Re: bug in Firefox???

hillerious, thanks for the making my day !!

Last edited by saltedm8; March 12th, 2008 at 07:57 PM..
saltedm8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox Vs IE7 (CSS) Monie HTML, XHTML and CSS 9 September 19th, 2007 10:37 PM
Useful Firefox Add-ons Antwan The Café 19 February 21st, 2007 12:02 PM
alt tag in Firefox afuller HTML, XHTML and CSS 8 December 9th, 2006 03:16 PM
Need help regarding firefox vs. ie james@thecultureofme HTML, XHTML and CSS 5 June 2nd, 2006 10:32 AM
IE ok, Firefox no way lizarddoctor HTML, XHTML and CSS 4 November 27th, 2005 07:35 PM


Search Engine Optimization by vBSEO 3.2.0 RC8