Okay, I'm trying to get this simple script found off the net to run, I can get it to bring up the popup window, but when I try to have the window contain an image, that's where things go to hell.
Function works fine with just text in the window, but not with image. Help a noOb out!
<script language="JavaScript1.2">
var closebutton = "http://www.google.com/cross.gif"; //Adress of image of the button
var raampje, xtra, ytra;
function sleepen(){if (event.button!=1)return;
raampje = eval("maildiv");temp1=raampje.style.posLeft;
temp2=raampje.style.posTop;xpos=event.clientX;
ypos=event.clientY;xtra = temp1-xpos;
ytra = temp2-ypos;document.onmousemove=plaats;}
function plaats(){if (event.button==1){
raampje.style.pixelLeft=event.clientX+xtra;
raampje.style.pixelTop=event.clientY+ytra;return false;}}
function raam(inside, color,width,height, background){
titlecolor = "silver";
opacitytitle = 40;
if(!width){
width = 500;
height = 325;}
if(inside.indexOf(".htm") > inside.length -6)
inside = "<iframe frameborder=0 name=\"raampje\" width="+(width-10)+" height="+(height-30)+" src=\""+inside+"\" scrolling=\"no\" ></iframe>";
if(!color)
color = "red";
var thisspan = eval("maildiv.style")
thisspan.pixelLeft = document.body.scrollLeft + 100;
thisspan.pixelTop = document.body.scrollTop + 100;
thisspan.visibility="visible";
output = "<table cellpadding=0 cellspacing=0 width=" + width + " height=" + height + " border=3><tr>";
output += "<td onmousedown='sleepen()' style='cursor:hand' onmouseup='JavaScript: document.onmousemove=\"\" ' bgcolor='"+titlecolor+"' style='filter:alpha(opacity="+opacitytitle+");' width =" + width + " height=20></td><td bgcolor='silver'>";
output += "<input type='image' alt=\"Close\" onclick='closeraam()' src='"+closebutton+"'></td></tr>";
output += "<tr><td width=100% colspan=2><table ";
if(background)output += "style='background-image:url(\" " + background + "\")'";
output += " width=100% height=100% bgcolor='"+color+"'><tr><td height=100% width=100% >"+ inside+"</td></tr></table></td></tr>";
maildiv.innerHTML = output;
}function closeraam(){maildiv.style.visibility="hidden";}
function firstwindow()
{
outp = "";
outp += "<center><h2>Help me get a picture in this stupid window!</h2>";
raam(outp, "white",400, 600, img.jpg); <-----doesn't work
}
</script>
Also tried these:
raam(outp, 400, 600, img.jpg); <-----doesn't work
raam(outp, 400, 600); <-----works, but not what I want!
calling with this:
onMouseOver="cOn(this);" onMouseOut="cOut(this);"
Function works fine with just text in the window, but not with image. Help a noOb out!
