Hi,
I've written some javascript routines for Internet Explorer and Opera.
Could you tell me the Netscape and Mozilla equivalents?
Thanks
-------------------------
//this works with Opera, not with Netscape and Mozilla:
var menuOpened = false;
var whatMenu = new Object();
function showMenu(menu){ //menu is the id of a DIV element
if ( menu == null ) return;
if (!menuOpened){
menu.style.visi bility='visible ';
menuOpened = true;
whatMenu = menu;
}
else{
menu.style.visi bility='hidden' ;
menuOpened = false;
whatMenu = null;
}
}
-----------------
//this works only with Internet Explorer and Opera
var clicksBold = 0;
function toggleBold(){
clicksBold++;
SPANs = document.all.ta gs("SPAN");
for (var h = 0; h < SPANs.length; h++){
x = SPANs[h];
if (x.className == "aClassName "){
if ((clicksBold % 2) == 1) x.style.fontWei ght = "bold";
else x.style.fontWei ght = "normal";
}
}
}
-----------------
colors = new Array("blue","c yan","lightgree n","green","red ","orange","yel low","pink","vi olet","black"," gray","white");
for (var j = 0; j < colors.length; j++){
document.write( "<span style='backgrou nd-color:" + colors[j] + ";
height:25; width:25; border-style:solid; border-width:1pt'></span>*");
}
//the output is a series of sqares in Internet Explorer and Opera,
some black lines in Netscape
--------------------------
//anID is the ID of a SPAN element
<select name="leftMargi n"
onchange="anID. style.marginLef t=this.value;">
....
</select> 3 2066 ca************* *******@yahoo.i t (Simba) writes: //this works only with Internet Explorer and Opera
var clicksBold = 0;
.... clicksBold++;
I would use
var clicksBold = false;
...
clicksBold = ! clicksBold;
It better models what you want: toggling between on and off.
SPANs = document.all.ta gs("SPAN");
Use:
var SPANs = document.getEle mentsByTagName( "SPAN");
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit. html>
'Faith without judgement merely degrades the spirit divine.'
Simba wrote: Hi,
I've written some javascript routines for Internet Explorer and Opera. Could you tell me the Netscape and Mozilla equivalents?
Thanks
-------------------------
//this works with Opera, not with Netscape and Mozilla:
var menuOpened = false; var whatMenu = new Object();
function showMenu(menu){ //menu is the id of a DIV element
if ( menu == null ) return;
if (!menuOpened){ menu.style.visi bility='visible ';
All 3 browsers and many other W3C DOM 1 compliant browsers (Safari 1.0,
Konqueror 3.1.x, MSIE 5.x for Mac, MSIE 5+, etc.) all support
document.getEle mentById("menu" ).style.visibil ity = "visible";
So, it is best for many reasons to use this manner of coding.
Using Web standards in your web pages http://www.mozilla.org/docs/web-deve...upgrade_2.html
Updating DHMTL Web pages http://devedge.netscape.com/viewsour...tml-web-pages/
menuOpened = true; whatMenu = menu; } else{ menu.style.visi bility='hidden' ; menuOpened = false; whatMenu = null; } }
-----------------
//this works only with Internet Explorer and Opera
var clicksBold = 0;
function toggleBold(){
clicksBold++;
SPANs = document.all.ta gs("SPAN");
Again, like Lasse said, best is to use
spanCollection = document.getEle mentsByTagName( "SPAN");
which is widely and well supported by W3C DOM 1 compliant browsers. for (var h = 0; h < SPANs.length; h++){ x = SPANs[h]; if (x.className == "aClassName "){ if ((clicksBold % 2) == 1) x.style.fontWei ght = "bold"; else x.style.fontWei ght = "normal"; } } }
-----------------
colors = new Array("blue","c yan","lightgree n","green","red ","orange","yel low","pink","vi olet","black"," gray","white"); for (var j = 0; j < colors.length; j++){ document.write( "<span style='backgrou nd-color:" + colors[j] + "; height:25; width:25; border-style:solid; border-width:1pt'></span> ");
There is a better alternative here to document.write.
DU
--
Javascript and Browser bugs: http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x http://www10.brinkster.com/doctorunc...e7Section.html
"Simba" <ca************ ********@yahoo. it> wrote in message
news:4e******** *************** ***@posting.goo gle.com...
<snip> for (var j = 0; j < colors.length; j++){ document.write( "<span style='backgrou nd-color:" + colors[j] + "; height:25; width:25; border-style:solid;bor der-width:1pt'></span> "); }
<snip>
In addition to what Lasse and DU said, the CSS standard requires that
length values used with CSS properties should be provided with units
(px, em, ex, pt, pc, etc or percentages) and Mozilla browsers are
inclined to take a rather literal attitude towards the interpretation of
applicable standards. height:25; may be ignored for that reason alone,
however, the SPAN element is inline and non-replaced so CSS width and
height properties do not apply to it anyway.
Richard. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: rez |
last post by:
I find it rather frustrating that Netscape 4.x is "no longer
supported:"
http://help.netscape.com/products/client/communicator/reflib.html
Same seems true with IE.
How am I ever supposed to make my scripts multi-browser, when they
don't bother giving me basic
documentation?
|
by: Gaurav |
last post by:
Hello,
i have some java script with in html. It runs fine on IE 6.0 but
doesnt run on netscape 7.1
Can someone tell me whats the problem ? And how can i solve it.
here is the url
http://godot.urol.uic.edu/output.html
|
by: Geniium |
last post by:
Hello,
Im looking to make work my script on both IE and Netscape. It works
fine in IE, but netscape cant handle "dynamic" variables. I need some
help!
Is there a CORRECT way to pass a string as parameter and then use it
as an object in Netscape? IE does that without problem... and Netscape
seems not able to handle it...
|
by: Fabian |
last post by:
Is there a way to detect which object currently has the focus in
javascript? "this" comes close, but isnt implemented in netscape.
--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk
|
by: zaw |
last post by:
Hi I am working on implementing this script to shopping cart.
Basically, it copies fill the shipping address from billing
automatically. I believe one or more syntax is not netscape
compatible. Can anyone point out which one it is and how to make it
both netscape and MS browser compatible? I hope if I can make the
script compatible for those two at extreme, it will probably work with
most browser out there. As you would notice, this form...
| |
by: chandramohan.mani |
last post by:
Does Event handlers work in netscape. If yes means can anyone please
help me.
<HTML><SCRIPT LANGUAGE="JScript">
function mouseclick() {
alert("I was clicked on " + window.event.srcElement.tagName);
}
</SCRIPT>
<BODY onclick="mouseclick()">
<H1>Welcome!</H1>
|
by: Jason |
last post by:
We have an Extranet with one customer with 20,000 users that has,
unfortunately, standardized on Netscape 4.77 for the entire company. We are
in the process of rewriting this application from Java to .NET and, of
course, would not like to be constrained by the Least Common Denominator
(LCD) this particular company represents.
Question: What is the best way to handle this without having to double the
development effort? For example, MVC...
|
by: Sam Learner |
last post by:
Hello,
I am writting a utility program to clean diskspace used by Web Browsers, I
can clean up Internet Explorer's temp folder.
but I also want to clean up Netscape (any version, but Current 7.2 version
preferrably) does anyone know where Netscape store its Cache, or Temp
Folder? and History?
and also how about AOL's Browser cache?
I am developping the Clean up software using VB .NET 2003
Any help would be appreciated.
|
by: Jake Barnes |
last post by:
In the course of my research I stumbled upon this article by Alex
Russel and Tim Scarfe:
http://www.developer-x.com/content/innerhtml/default.html
The case is made that innerHTML should never be used. I'm wondering, If
I wanted all the content of BODY as a string, how else could I get
except through innerHTML?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |