Looking for some simplified instructions on how to add a single line URL for the javascript window.open function/command thing..
I thought I had it down, but everytime I clicked on the link that would open the new window, it would do so.. and also change the source page to a blank page with just [object] for text on it.. Here's what I want to do:
Have a page with text and a link in the text that links to a picture that pops up in a window that is sized to the picture (specifying the window/image size in the html code) when the text is clicked on.
I thought the syntax was simple like
< a href="javascript:window.open('http://www.blah.com/img/image.jpg','win ... height=200')" >link text< /a >
*shrug*
As an added bonus, what's the command for the mouse-over 'tool tip' type text that pops up? (not in a new window, just text).
Javascript Help
- Fash
- Way too much time!
- Posts: 4147
- Joined: July 10, 2002, 2:26 am
- Gender: Male
- XBL Gamertag: sylblaydis
- Location: A Secure Location
best method is...
having a snip of javascript at the top of the file,
and then use
and the tool-tip for links or images is set with the ALT tag.
having a snip of javascript at the top of the file,
Code: Select all
<script language="JavaScript">
function popUp(URL,height,width) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=" + width + ",height=" + height + "');");
</script>
Code: Select all
<A HREF="javascript:popUp('http://www.whatever.com/whatever',200,200)" alt="pic name">Open the Popup Window</A>
Fash
--
Naivety is dangerous.
--
Naivety is dangerous.