Fredde
01-30-2003, 07:37 AM
Pretty new javascripter here who really needs help.
What I´m trying to do is have a table with different building pictures on. (Not real buildings, painted. I´m working on a "build a little city script") What I want is that when you move your mouse over the different pictures a small window popups next to the picture with information on the building in the picture. The coding goes here: (dont mind the strange language in the coding, it is just some good ol´swedish)
Here is the function for the popup window:
function popupwin1() {
winpopup= window.open(",'popup','height=200,width=100,menubar=no,scrollbar=no,status=no,
toolbar=no,left=300,top=150');
winpopup.document.write('<HTML>\n<HEAD>\n');
winpopup.document.write('<TITLE>Byggnads information</TITLE>\n');
winpopup.document.write('</HEAD>\n');
winpopup.document.write('<BODY>\n');
winpopup.document.bgcolor= "#F0ECC9";
winpopup.document.fgcolor= "#75746D";
winpopup.document.write('<IMG SRC="images/murhogeroverhorn.gif" HEIGHT =20 WIDTH =20><BR>
winpopup.document.write('<PRE>Muren hjälper till att skydda ditt land och dina
grödor mot anfall</PRE>')
winpopup.document.close();
}
Here is when the window should popup:
output += '<TD BGCOLOR =#C7C4C4><input type ="image" SRC="images/huvudhus.gif" onMouseOver ="popupwin1();"></TD>';
output += '</TABLE>';
document.write(output);
Maybe you can´t open a new window with onMouseOver(), just with onClick()? I have no idea, so all help is greatly accepted
What I´m trying to do is have a table with different building pictures on. (Not real buildings, painted. I´m working on a "build a little city script") What I want is that when you move your mouse over the different pictures a small window popups next to the picture with information on the building in the picture. The coding goes here: (dont mind the strange language in the coding, it is just some good ol´swedish)
Here is the function for the popup window:
function popupwin1() {
winpopup= window.open(",'popup','height=200,width=100,menubar=no,scrollbar=no,status=no,
toolbar=no,left=300,top=150');
winpopup.document.write('<HTML>\n<HEAD>\n');
winpopup.document.write('<TITLE>Byggnads information</TITLE>\n');
winpopup.document.write('</HEAD>\n');
winpopup.document.write('<BODY>\n');
winpopup.document.bgcolor= "#F0ECC9";
winpopup.document.fgcolor= "#75746D";
winpopup.document.write('<IMG SRC="images/murhogeroverhorn.gif" HEIGHT =20 WIDTH =20><BR>
winpopup.document.write('<PRE>Muren hjälper till att skydda ditt land och dina
grödor mot anfall</PRE>')
winpopup.document.close();
}
Here is when the window should popup:
output += '<TD BGCOLOR =#C7C4C4><input type ="image" SRC="images/huvudhus.gif" onMouseOver ="popupwin1();"></TD>';
output += '</TABLE>';
document.write(output);
Maybe you can´t open a new window with onMouseOver(), just with onClick()? I have no idea, so all help is greatly accepted