|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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'); |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Trouble with div and css events |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|