Forum Moderators: open

Message Too Old, No Replies

help with java open new image window script

script shows error

         

ashok

11:14 am on Jul 29, 2004 (gmt 0)

10+ Year Member



I am trying to use script to show images (i have many) on a page, in a new window that pops up without bars.
In head I have:
<script language="javascript">
<!--
function openMywindow(image){
open("images/" +image,"scrollbars=0,width=600,height=450,top=5,left=5").focus();
}
-->
</script>

in body I have:
<td>
<a href="javascript:openMywindow('pic.jpg')">
<img src="images/pic.JPG" width="100" align="center"></a>
</td>

When I view it shows error in line "X" , which comes out to be line 5 of script in head, being "}".

Please help. What I am doing wrong?
Thanks.
+Saini4u

robotsdobetter

11:19 am on Jul 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this tool at javascript.internet.com/generators/popup-window.html.

ashok

12:32 pm on Jul 29, 2004 (gmt 0)

10+ Year Member



Thanks.
Works great.
By chance do you know any css vertical dropdown menu generator?
I have issues in that too.

+Saini4u

Jumper Willow

8:41 am on Jul 30, 2004 (gmt 0)

10+ Year Member



here's one i've used

<head>
<style type="text/css">
table.menu { position:absolute; visibility:hidden; }
</style>
<script type="text/javascript">
function showmenu(elmnt)
{
document.all(elmnt).style.visibility="visible"
}
function hidemenu(elmnt)
{
document.all(elmnt).style.visibility="hidden"
}
</script>
</head>
<body>

<table>
<tr>
<td onmouseover="showmenu('menu1')" onmouseout="hidemenu('menu1')">
Menu heading text

<table class="menu" id="menu1">
<tr><td>selection 1</td><tr>
<tr><td>selection 2</td></tr>
</table>

</td></tr></table>

It uses mouseovers in the <td> which isn't xhtml strict (strike one) and I've heard that it won't work in mozilla either (strike two). I've used it and it's decently easy to setup.

The main table contains the headers of the menu, and each sub table is the sub menu for that heading. Lemme know if It's clear.