Hej NG,
I nedenstående kildekode har jeg en lille menu - så fint så godt.
Jeg ønsker blot, at der hvor der står "Smykker" samt "Ure" - dér
skal der være et lille billede, som så skal skiftes ud
(onmouseover), når musen rører ved billedet/linket/knappen.
Nogender kan hjælpe stakkels mig
Koderne er som følger:
__________________________________________
<html>
<head>
<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>
<style type="text/css">
body {
background-image: url("../images/roseleft.jpg");
background-repeat: no-repeat;
background-attachment: fixed;
background-position: left bottom;}
menutitle{
cursor:pointer;
margin-bottom: 2px;
background-color:transparent;
color:#000000;
width:200px;
padding:2px;
text-align:left;
font-weight:bold;
/*/*/border:0px solid #000000;/* */
}
submenu{
margin-bottom: 0.5em;
}
</style>
<script type="text/javascript">
var persistmenu="yes" //"yes" or "no". Make sure each SPAN
content contains an incrementing ID starting at 1 (id="sub1",
id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist
across site, "local" for this page only
if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar =
document.getElementById("masterdiv").getElementsByTagName("span")
;
if(el.style.display != "block"){
for (var i=0; i<ar.length; i++){
if (ar[i].className=="submenu")
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" :
window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}
function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" :
window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" :
blockid
document.cookie=cookiename+"="+cookievalue
}
if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction
if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate
</script>
</head>
<body bgcolor="#FFFFFF" topmargin="0" leftmargin="10"
link="#000000" vlink="#000000" alink="#000000"
background="../images/roseleft.jpg">
<!-- Keep all menus within masterdiv-->
<div id="masterdiv">
<div class="menutitle" onclick="SwitchMenu('sub1')"
style="width: 200"><p align="left"><font size="5"><font
face="NuptialScript">Smykker</font></div>
<span style="letter-spacing: 2" class="submenu" id="sub1">
<font face="NuptialScript" size="3">
- <a href="#" target="main"><b>Guld</b></a><br>
- <a href="#" target="main"><b>Sølv</b></a><br>
- <a href="#" target="main"><b>Diamant</b></a></span></font>
<div class="menutitle" onclick="SwitchMenu('sub2')"
style="width: 200"><p align="left"><font
face="NuptialScript">Ure</font></div>
<span style="letter-spacing: 2" class="submenu" id="sub2">
<font face="NuptialScript" size="3">
- <a href="#" target="main"><b>Seiko</b></a><br>
- <a href="#" target="main"><b>Dolce & Cabbana</b></a><br>
- <a href="#" target="main"><b>Junghans</b></a><br>
- <a href="#" target="main"><b>Festina</b></a><br>
- <a href="#" target="main"><b>Casio</b></a><br>
- <a href="#" target="main"><b>Pulsar</b></a><br>
- <a href="#" target="main"><b>Lorus</b></a>
</font>
</span>
</body>
</html>
__________________________________________
Med vanlig venlig hilsen fra
\Fedtmule/
--
Vil du lære at kode HTML, XHTML, CSS, SSI, ASP eller ASP.NET?
- Pædagogiske tutorials på dansk
- Kom godt i gang med koderne
KLIK HER! =>
http://www.html.dk/tutorials