SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: IE function in Mozilla
-
Oct 1, 2002, 02:58 #1
- Join Date
- Aug 2001
- Location
- Amsterdam
- Posts
- 788
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
IE function in Mozilla
Getting this function to work in more browsers than only ie....
Does anyone have a clue if I can get this function to work in Netscape and mozilla
Code:<script language="javascript"> <!-- function expand(listID) { if (listID.style.display=="none") { listID.style.display=""; } else { listID.style.display="none"; } } //--> </SCRIPT>
Peanutsthe neigbours (free) WIFI makes it just a little more fun
-
Oct 1, 2002, 07:05 #2
- Join Date
- Jul 2002
- Location
- Dallas, TX
- Posts
- 2,900
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Here's a function I use that performs a very similar task. I'll use the PHP tags here for the comment coloring, but the code is regular JS
PHP Code:function toggleDisp(node) {
if (is_ie4up) // Sniffer variable
node.style.display = (node.currentStyle.display == 'none') ? 'block' : 'none';
else if (is_gecko) { // Sniffer variable
node.style.display = (node.style.display == 'none' || node.style.display == '') ? 'block' : 'none';
}
else
alert('Your browser does not have the javascript support for these menu featuers.\nPlease upgrade to the most recent version of Internet Explorer, Netscape, or Mozilla.');
}
-
Oct 1, 2002, 09:23 #3
- Join Date
- Aug 2001
- Location
- Amsterdam
- Posts
- 788
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
where do you get the variables from to know if it's ie or something else??
I now how to do that in PHP but not in js
greets peanutsthe neigbours (free) WIFI makes it just a little more fun
-
Oct 1, 2002, 09:42 #4
Bookmarks