NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page JavaScript rollover problem

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 02-23-2006, 06:12 PM THREAD STARTER               #1 (permalink)
TyR
NamePros Member
 
TyR's Avatar
Join Date: Dec 2005
Location: Norway
Posts: 66
TyR is an unknown quantity at this point
 



JavaScript rollover problem


hi, im trying to create a neat little script that displays a text inside a div, heres what i have so far:

PHP Code:
<div id="pie">Latest Tutorials</div>

<
a href="#" onmouseout="hidetmb()" onmouseover="showtmb('Hello World')"><img src="someicon.png"></a>
<
a href="#" onmouseout="hidetmb()" onmouseover="showtmb('w00t')"><img src="someicon.png"></a>
<
a href="#" onmouseout="hidetmb()" onmouseover="showtmb('a spoon')"><img src="someicon.png"></a>
????: NamePros.com http://www.namepros.com/programming/170622-javascript-rollover-problem.html
????: NamePros.com http://www.namepros.com/showthread.php?t=170622

<
script language="JavaScript">
<!--

function 
showtmb(texty){
    
this.pie.innerHTML texty;
}
function 
hidetmb(){
    
this.pie.innerHTML "Latest Tutorials";
}
-->
</script> 
It works fine in internet explorer, but I cant get it to work in FireFox :/ any ideas?
Last edited by TyR; 02-23-2006 at 11:09 PM.
TyR is offline  
Old 02-24-2006, 01:50 PM   #2 (permalink)
Tech Support
Join Date: Mar 2005
Posts: 4,944
Eric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatnessEric Has achieved greatness
 

Member of the Month
MOTM September 2005
Save a Life Child Abuse 9/11/01 :: Never Forget Baby Health Marrow Donor Program AIDS/HIV Breast Cancer Animal Rescue Cystic Fibrosis Ethan Allen Fund Animal Cruelty Ethan Allen Fund Ethan Allen Fund Baby Health Cancer Alzheimer's Protect Our Planet Cancer Survivorship SIDS Child Abuse Diabetes Protect Our Planet Multiple Sclerosis Autism Adoption Special Olympics
Hmm... Try this:
HTML Code:
<script language="JavaScript">
<!--

function showtmb(texty)
{
  document.getElementById('pie').innerHTML = texty;
}
function hidetmb()
{
  document.getElementById('pie').innerHTML = "Latest Tutorials";
}
// -->
</script>
Last edited by SecondVersion; 02-24-2006 at 02:10 PM.
Eric is offline  
Old 02-24-2006, 02:07 PM   #3 (permalink)
Dan
Buy my domains.
 
Dan's Avatar
Join Date: Feb 2006
Posts: 2,792
Dan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant futureDan has a brilliant future
 


Autism Autism Autism Autism Autism Autism Autism
Code:
<div id="pie">Latest Tutorials</div>

<a href="#" onmouseout="hidetmb()" onmouseover="showtmb('Hello World')"><img src="someicon.png"></a>
<a href="#" onmouseout="hidetmb()" onmouseover="showtmb('w00t')"><img src="someicon.png"></a>
<a href="#" onmouseout="hidetmb()" onmouseover="showtmb('a spoon')"><img src="someicon.png"></a>

<script language="JavaScript">
function showtmb(texty){
    document.getElementById('pie').innerHTML = texty;
}
function hidetmb(){
    document.getElementById('pie').innerHTML = "Latest Tutorials";
}
</script>
BTW, what does <!-- and --> do inside of the script?
????: NamePros.com http://www.namepros.com/showthread.php?t=170622

edit: It works; I just tested it.
Dan is offline  
Old 02-24-2006, 03:17 PM THREAD STARTER               #4 (permalink)
TyR
NamePros Member
 
TyR's Avatar
Join Date: Dec 2005
Location: Norway
Posts: 66
TyR is an unknown quantity at this point
 



Thanks guys! 'tworks
TyR is offline  
Old 02-26-2006, 12:27 PM   #5 (permalink)
A Wealth of Knowledge
 
stscac's Avatar
Join Date: Aug 2004
Posts: 3,803
stscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud ofstscac has much to be proud of
 



Originally Posted by Dan Friedman
BTW, what does <!-- and --> do inside of the script?
It supposedly hides Javascript from older browsers. It is essentially outdated now, since the use of older browsers (browsers not supporting javascript) in web terms are ancient and non-existant today.



Although I did play around with NS4 the other day
????: NamePros.com http://www.namepros.com/showthread.php?t=170622
Very poor CSS support at best.

-Steve
stscac is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems. They can ruin your day if you don't have the right perspective. BobParsons.com Business Development 0 12-16-2005 11:38 PM

 
All times are GMT -7. The time now is 02:10 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger