*GabrielOak*
03-30-2001, 10:58 AM
hi there, this is my first post... i need help getting my javascript to make the image i use for the'mouseover' state to stay when the mouse is moved off the graphic. only to change when another link is clicked. basically this is so that the user can see which section of the site they are in/have clicked on coz it's stayed in the 'mouseover' state... does any of that make sense?! much appreciate help! (can't post url as site isn't live yet). cheers, *g*
Dr. Web
03-30-2001, 12:27 PM
GabrielOak,
Welcome to HTML forums.
Showing the page you are on can be a hard thing to do.
www.designsbymark.com
uses the same nav bar at the top for all screens. He just decided to place a header stating which page you were on.
while http://encarta.msn.com/default.asp (@msn.com) changes the link color of the text itself to show which page you are on.
Each example links to a NEW page, so the changes can be hard coded into you 'linked' page. For example, if I were on the home page.....I might make my home link grey, while the rest of the links are bright red.
If you need more info, or want some tutorials:
www.Volcanic-Design.com/volc_links.htm
Detlef
04-01-2001, 08:09 PM
Hi,
I solved this problem using "Dreamweaver".
Itīs still complicated, but easier than
hardcore-programming. Hereīs the code:
<html><head><title>Schluesseldienst Dethlefs Information2</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_preloadImages() { //v2.0
if (document.images) {
var imgFiles = MM_preloadImages.arguments;
if (document.preloadArray==null) document.preloadArray = new Array();
var i = document.preloadArray.length;
with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#"){
preloadArray[i] = new Image;
preloadArray[i++].src = imgFiles[j];
} }
}
function MM_swapImage() { //v2.0
var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
(objStr.indexOf('document.all[') ==0 && document.all ==null))
objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
obj = eval(objStr);
if (obj != null) {
swapArray[j++] = obj;
swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
obj.src = MM_swapImage.arguments[i+2];
} }
document.MM_swapImgData = swapArray; //used for restore
}
function MM_swapImgRestore() { //v2.0
if (document.MM_swapImgData != null)
for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
}
//-->
</script>
</head>
<body topmargin="0" bgcolor="#70BC98" onLoad="MM_preloadImages('Downloada.gif','#979911189140');MM_preloadImages('Hauptseite.gif','#979911303440') ;MM_preloadImages('Information.gif','#979911412690');MM_preloadImages('Katalog.gif','#979911438340') ;MM_preloadImages('Neuheiten.gif','#979911468380');MM_preloadImages('Hauptseitea.gif','#979911500400 ');MM_preloadImages('download.gif','#979911532150');MM_preloadImages('Information.gif','#97991155104 0');MM_preloadImages('Katalog.gif','#979911569060');MM_preloadImages('Neuheiten.gif','#979911590860' );MM_preloadImages('Informationa.gif','#979911615960');MM_preloadImages('download.gif','#97991163728 0');MM_preloadImages('Hauptseite.gif','#979911653150');MM_preloadImages('Katalog.gif','#979911677260 ');MM_preloadImages('Neuheiten.gif','#979911699120');MM_preloadImages('Kataloga.gif','#979911730700' );MM_preloadImages('download.gif','#979911753390');MM_preloadImages('Hauptseite.gif','#979911766790' );MM_preloadImages('Information.gif','#979911783320');MM_preloadImages('Neuheiten.gif','#97991179975 0');MM_preloadImages('Neuheitena.gif','#979911826270');MM_preloadImages('download.gif','#97991184072 0');MM_preloadImages('Hauptseite.gif','#979911863570');MM_preloadImages('Information.gif','#97991188 0380');MM_preloadImages('Katalog.gif','#979911901080')">
<div align="center">
<table border="0" width="85%">
<tr>
<td>
<div align="center"><a href="download.htm" target="oben" onClick="MM_swapImage('document.Image1','document.Image1','Downloada.gif','#979911189140');MM_swapImage('docu ment.Image2','document.Image2','Hauptseite.gif','#979911303440');MM_swapImage('document.Image3','doc ument.Image3','Information.gif','#979911412690');MM_swapImage('document.Image4','document.Image4','K atalog.gif','#979911438340');MM_swapImage('document.Image5','document.Image5','Neuheiten.gif','#9799 11468380')"><img src="download.gif" width="150" height="30" border="0" name="Image1"></a></div>
</td>
<td>
<div align="center"><a href="hauptseite.htm" target="oben" onClick="MM_swapImage('document.Image2','document.Image2','Hauptseitea.gif','#979911500400');MM_swapImage('do cument.Image1','document.Image1','download.gif','#979911532150');MM_swapImage('document.Image3','doc ument.Image3','Information.gif','#979911551040');MM_swapImage('document.Image4','document.Image4','K atalog.gif','#979911569060');MM_swapImage('document.Image5','document.Image5','Neuheiten.gif','#9799 11590860')"><img src="Hauptseite.gif" width="150" height="30" border="0" name="Image2"></a></div>
</td>
<td>
<div align="center"><a href="info.htm" target="oben" onClick="MM_swapImage('document.Image3','document.Image3','Informationa.gif','#979911615960');MM_swapImage('d ocument.Image1','document.Image1','download.gif','#979911637280');MM_swapImage('document.Image2','do cument.Image2','Hauptseite.gif','#979911653150');MM_swapImage('document.Image4','document.Image4','K atalog.gif','#979911677260');MM_swapImage('document.Image5','document.Image5','Neuheiten.gif','#9799 11699120')"><img src="Information.gif" width="150" height="30" border="0" name="Image3"></a></div>
</td>
<td>
<div align="center"><a href="anfrage.htm" target="oben" onClick="MM_swapImage('document.Image4','document.Image4','Kataloga.gif','#979911730700');MM_swapImage('docum ent.Image1','document.Image1','download.gif','#979911753390');MM_swapImage('document.Image2','docume nt.Image2','Hauptseite.gif','#979911766790');MM_swapImage('document.Image3','document.Image3','Infor mation.gif','#979911783320');MM_swapImage('document.Image5','document.Image5','Neuheiten.gif','#9799 11799750')"><img src="Katalog.gif" width="150" height="30" border="0" name="Image4"></a></div>
</td>
<td>
<div align="center"><a href="neuheiten.htm" onClick="MM_swapImage('document.Image5','document.Image5','Neuheitena.gif','#979911826270');MM_swapImage('doc ument.Image1','document.Image1','download.gif','#979911840720');MM_swapImage('document.Image2','docu ment.Image2','Hauptseite.gif','#979911863570');MM_swapImage('document.Image3','document.Image3','Inf ormation.gif','#979911880380');MM_swapImage('document.Image4','document.Image4','Katalog.gif','#9799 11901080')" target="oben"><img src="Neuheiten.gif" width="150" height="30" name="Image5" border="0"></a></div>
</td>
</tr>
</table>
</div>
</body></html>
You can have a look at it at:
http://www.schluesseldienst-dethlefs.de
*GabrielOak*
04-04-2001, 08:38 AM
thanks for the help!
-Detlef, hacked about with your code and got it to work - thanks! Will post URL when site goes live. *g*
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.