JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 5th, 2005, 11:25 PM
nataku92 nataku92 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 9 nataku92 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 49 m 50 sec
Reputation Power: 0
iframe in firefox issue

I've made a website that uses mainly iframes. I also use a seperate iframe for links. And within my links.html document, I have a links that display/hide certain links within divs when clicked. And the scripting for that is:

Code:
<script type="text/javascript">
<!--
function drop(a) {
   if (a.style.display == 'none') {
       a.style.display='block';
}
   else {
       a.style.display='none';
}
}
//-->
</script>


This works fine in IE, but doesn't work in firefox. I've tried moving the javascript to the main document and linking to there, but I can't seem to target the links within the divs. Any help would be great.

Reply With Quote
  #2  
Old May 6th, 2005, 12:35 AM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,817 jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 7 h 14 m 56 sec
Reputation Power: 1098
How are you using the function? Show the code used to call drop().
__________________
# Jeremy

Explain your problem instead of asking how to do what you decided was the solution.

Reply With Quote
  #3  
Old May 6th, 2005, 12:40 AM
nataku92 nataku92 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 9 nataku92 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 49 m 50 sec
Reputation Power: 0
Code:
<a href="javascript:drop(menu);" target="_self">My Models</a><br>
<div id="menu" style="display: none; margin-left: 15px;">
<a href="gundam.html">Gundams</a><br>
<a href="planes.html">Aircraft</a><br>
<a href="home.html">Other</a>
</div>

Reply With Quote
  #4  
Old May 6th, 2005, 12:59 AM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,817 jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 7 h 14 m 56 sec
Reputation Power: 1098
I think you're getting a side-effect of using "a" as your object in IE.
Code:
<script type="text/javascript">
<!--
function drop(elementId) {
  var objElement = document.getElementById(elementId);
   if (objElement.style.display == 'none') {
       objElement.style.display='block';
}
   else {
       objElement.style.display='none';
}
}
//-->
</script>

Reply With Quote
  #5  
Old May 6th, 2005, 02:21 AM
Kravvitz's Avatar
Kravvitz Kravvitz is offline
CSS & JS/DOM Adept
Dev Shed God 30th Plane (19500 - 19999 posts)
 
Join Date: Jul 2004
Location: USA
Posts: 19,890 Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level)Kravvitz User rank is General 48th Grade (Above 100000 Reputation Level) 
Time spent in forums: 6 Months 2 Days 17 h 55 m 47 sec
Reputation Power: 4192
That would work if menu was a variable, but it's an ID.
Code:
<a href="javascript:drop(document.getElementById('menu'));" target="_self">My Models</a>

or with Jeremy's function
Code:
<a href="javascript:drop('menu');" target="_self">My Models</a>

Reply With Quote
  #6  
Old May 6th, 2005, 06:43 PM
nataku92 nataku92 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 9 nataku92 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 49 m 50 sec
Reputation Power: 0
Yay, it worked! Thanks for the help!

Reply With Quote
  #7  
Old May 6th, 2005, 07:02 PM
acidfourtyfive's Avatar
acidfourtyfive acidfourtyfive is offline
Since 439000000
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2004
Location: Canada
Posts: 1,134 acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 23 h 30 m 11 sec
Reputation Power: 122
Sometimes I have a similar problem with syntax. Like
getElementByID() instead of using getElementById()

Reply With Quote
  #8  
Old May 6th, 2005, 07:06 PM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
Dev Shed God 11th Plane (10000 - 10499 posts)
 
Join Date: Jul 2003
Location: I used to live at home, now I stay at the house
Posts: 10,180 ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)ChiefWigs1982 User rank is General 16th Grade (Above 100000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 5 Days 19 h 56 m 47 sec
Reputation Power: 2037
Quote:
Originally Posted by acidfourtyfive
Sometimes I have a similar problem with syntax. Like
getElementByID() instead of using getElementById()

Erm... Ok, but how is that similar?
__________________
Support requests via PM will be ignored!
Sites: WordPress Metro Theme | Route of Queue
Read These: The General Rules Thread | The General FAQ Thread | NEW USERS - How to post a question


Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > iframe in firefox issue

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap