Website design question


#1

Hey I’m trying to redo my website using a combination of javascript, CSS, and html. I’m haveing problems getting my thumbnails to open in a new window that resizes to a fixed size…Here’s the line of code I got now that links to my full image:
<a href=“dig4.html” onClick=“window.resizeTo(680,680)”,“target=”_blank">
and what I’m getting when i do that is the new window resizing as well as the old window and I can’t figure out why the old window is resizing too!! I’m sure its real simple and I’m an idiot but somehow i can’t figure it out…any help would be great!

Thanks


#2

Im not sure if this is the right forum. Try a HTML forum next time, will probably give you more feedback!

anyway, the html below will open a new window with the size 500x500. The source code is generated by Macromedia Dreamweaver.

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”>
<title>Untitled Document</title>
<script language=“JavaScript” type=“text/JavaScript”>
<!–
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//–>
</script>
</head>
<body>
<a href=“javascript:MM_openBrWindow(‘foo.html’,’’,‘width=500,height=500’)”>Foo
</a>
</body>
</html>

Is this what you are looking for?

-mk-


#3

YES!! Thank you very much that worked perfectly!! I wasn’t on that track at all I was trying everything but that, I think! Thanks again for your time!!


#4

FYI, in your first post when your code was: window.resizeTo() that was implicit, in fact it I would have expected it to resize the “this” window. You have to be more explicit with what object you want the action applied to. “window” alone usually means the current window.


#5

to improve on the above slightly:

<a href=“foo.html” onclick=“javascript:MM_openBrWindow(this.href,’’,‘width=500,height=500’)”>Foo</a>

what went before isnt wrong, im just a stickler for accessibility (i work within education so its very important to be inclusive) where a barrier can be easily solved.

this way if the user doesnt have javascript on for whatever reason (or if you manage to break the javascript by accident and dont realise), they will still be able to access the page as the onclick event just wont be raised by the browser


#6

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.