
Originally Posted by
MrMatt
<SCRIPT type=text/javascript>
That attribute value must be quoted.
"Hiding" the contents of script and style elements has been unnecessary since the introduction of Netscape 2. That should be at least six years ago. Stop doing that.
"toolbar=no,menubar=no,status=yes,location=no,scrollbars=no,resizable=no,width=525,height=525"
Setting the size of a window yet removing the scroll bars and preventing it from being resized is, quite frankly, dumb no matter what is being placed within the window. If the user doesn't need to resize the window, providing that ability does no harm. Similarly, if the scroll bars aren't needed, there's no problem. However, if for some reason either of those features are necessary, you've just made that window very difficult to use.
By the way, a shorter (corrected) version of that feature string is
Code:
'status,resizable,scrollbars,width=525,height=525'
leftrightslide[0]='<a href="javascript
:Start('images/x_01_large.jpg')"><img src="images/x_01.jpg" border=1></a>'
The javascript: pseudo-protocol was intended to be used when the content of a document was to be replaced based on the interpretation of some Javascript code. Be that as it may, the pseudo-protocol should not be used on the Web as it provides users with no scripting support no fallback.
The link above should be written:
HTML Code:
<a href="images/x_01_large.jpg" target="ctrlWindow"
onclick="OpenWin=openWindow(this, 525, 525);return false;"
><img alt="Provide your own alternative text, even if it's an empty string"
src="images/x_01.jpg"
></a>
with openWindow defined as
Code:
function openWindow(link, width, height) {
return window.open(
link.href,
link.target,
'status,scrollbars,resizable,width=' + width + ',height=' + height
);
}
Make openWindow more (or less) generic as you see fit. If you want to control the border around the img element, use CSS. At a basic level, you'd achieve the same effect with
Code:
a img {
border: 1px solid;
}
The border should inherit the colour of the link. However, as that would apply to all images within links, you may need to be more specific with your selector.
Mike
Bookmarks