SunQuest
           Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

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 Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 28th, 2003, 04:55 PM
Jester Jester is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: England
Posts: 271 Jester User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Trouble with div and css events

Hi all,

Yet again I've come across another something that runs on one browser on not another :laugh:

This works on IE6, but fails miserably under Mozilla (and most likely Netscape as well - untested)
Code:
<select name=share_date OnChange="swap(date_panel)">
    blah blah blahdy blah
<div id="date_panel" style="display:'none;'">
    blah blah blahdy blah
</div>

and the javascript that runs it is simply:
Code:
function swap(ctrl) {
    if (ctrl.style.display == "none") {
        ctrl.style.display = "";
    } else {
        ctrl.style.display = "none";
    }
}

does anyone know a similar idea that will work for Mozilla & Netscape (if needed), or something that will work for all three browsers without two code pieces dependant on browser type?

Thanks, J

Reply With Quote
  #2  
Old September 28th, 2003, 08:38 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Trouble with div and css events

instead of referencing your object as 'data_panel', do it the proper, cross-browser, standards compliant way

document.getElementById('data_panel');

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Trouble with div and css events


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway