Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 innerHTML and FireFox
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 09 November 2004 :  14:49:30  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
I have a script I'm trying to implement into a clients design, wich changes the text in a div tag based on what link you're hovering over, but it dosnt work in firefox, wondering if their might be a workaround...

in the <head> tags I have the following:


var content=new Array();
content[0]='<strong>Stitches4u.biz</strong><br>Description here, blah blah blah blah blah blah blah blah blah blah blah blah blah blah';
content[1]='<strong>WeSingMusic.com</strong><br>Description here, blah blah blah blah blah blah blah blah blah blah blahb lah blah blah blah blahb lha';
content[2]='<strong>Coreyreferrals.com</strong><br>Description here, blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah ';
content[3]='<strong>Sunshine Products</strong><br>Description here, blah blah blah blah blahblah blah blah blah blah blah blah blah blah blah blah blah blah ';
function changetext(whichcontent){
if (document.all)
descriptions.innerHTML=whichcontent;
}
function reset(){
if (!scriptmenu.contains(event.toElement))
descriptions.innerHTML=temphtml;
}


Then for the mouseover, I have this within an img tag...


onMouseover="changetext(content[0])"

the array identifier changes per image of course

Then for the div to display the message looks like this:


<div id="descriptions" align="left">


Then under the div tags I have the following, to reset the message


<script language="JavaScript1.2">
if (document.all)
var temphtml=descriptions.innerHTML;
</script>

Any ideas?

-Stim

Edited by - Da_Stimulator on 09 November 2004 14:51:04

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 09 November 2004 :  18:35:02  Show Profile
Use document.getElementById("descriptions").innerHTML=whichcontent.

Document.all is being deceprecated I believe. W3C HTML standard suggests to use getElementById().

Support Snitz Forums

Edited by - Davio on 09 November 2004 18:36:05
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 09 November 2004 :  18:48:21  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Thx davio, that did the trick :)

-Stim
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 09 November 2004 :  18:49:59  Show Profile  Visit dayve's Homepage
This is something similar to what I am using at my forum and had tested on Mozilla. I did on OnClick to change the menu links to the word "Loading..." using a simple function like this...


function loadMessage(htmlID){
  document.getElementById(htmlID).innerHTML="<i style='color:silver;'>Loading...</i>";
}


and in any link I want this to work with I add the onClick


<a href="active_users.asp" onclick="loadMessage('msgAU')" id="msgAU">Active Users</a>


As long as you ID the anchor this function works like a champ.

Go to Top of Page

PeeWee.Inc
Senior Member

United Kingdom
1893 Posts

Posted - 09 November 2004 :  18:59:35  Show Profile  Visit PeeWee.Inc's Homepage
I really like that Dayve. Just went and had a look at it on your forum

Mind if i steal it for my site?

De Priofundus Calmo Ad Te Damine
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 09 November 2004 :  19:00:47  Show Profile  Visit dayve's Homepage
that's what this place is all about. I don't mind at all.

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 09 November 2004 :  19:04:39  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
That is pretty cool dayve.... I might borrow that too

-Stim
Go to Top of Page

PeeWee.Inc
Senior Member

United Kingdom
1893 Posts

Posted - 09 November 2004 :  19:37:02  Show Profile  Visit PeeWee.Inc's Homepage
quote:
Originally posted by dayve

that's what this place is all about. I don't mind at all.



I always like to ask before i copy something thats someone here has done

Wouldnt wanna pee anyone off by stealing something without asking

De Priofundus Calmo Ad Te Damine
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 09 November 2004 :  19:55:45  Show Profile  Visit dayve's Homepage
that's cool... but I'll never post code nor snippets in public forums that I don't want someone to use.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07