...

View Full Version : One popup window for many images to use, no toolbars, please help. Thanks



ginataylor50
06-21-2002, 10:53 PM
Hi javascript guru's

Please help with this one, I've been battling all day trying different scripts but none of them seem to work.
I don't want to have to make hundred of htm pages for all the different images, I just want to use ONE pop up window and let all my images use that, all the images are the same size and they all link from seperate thumbnail images. (Small thumbnail, if interested click that to see the larger image).
I'd like the pop up window to go centre on the screen if possible and I'd like it to just be a window, no toolbars.
I was given a one script that I thought should work but I can't get it to, I don't know what I am doing wrong.

<a href="javascript:thumbNailer("picture.gif");">click click</A>

<script><!--
function thumbNailer(pic) {
var newWin = window.open('standardpage.htm','picwindow','addrbar=0,toolbar=0,
location=0,directories=0,status=1,menubar=0,scrollbars=0,resizeable=0,width=550,height=425');
newWin.document.images['thePic'].src = pic;
}
//--></script>

inside of your standard picture file, you have an empty of invisible picture. this changes the source of that picture to whatever image you pass.

I am afraid you may have to explain in very simple terms as I am not very good at (thinking) :( :o

Thanks very much in advance.

ACJavascript
06-22-2002, 04:20 AM
Hi gin,

Well I see a couple of things that might make it work :D


1) <a href="java script:
It should be
<a href="javascript:
One word

2) The fundtion your useing doesn't look right to me so heres another function that you can use.


------------



<script language="javascript">

function picture(pic){
var no="addrbar=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizeable=0,"
no+="width=550,height=425"

var mywin=window.open("","def",no)

mywin.document.write("<center><img src='"+pic+"'>")
mywin.document.write("<BR><BR><BR>")
mywin.document.write("<input type='button' value=' Close Window ' onclick='javascript:window.close()'>")

}
</script>

</head>
<body>

<a href="javascript::picture('ImageSRC')"> Click here</a>




Hope this helped :D

HappyScripting :D:D:D

ginataylor50
06-22-2002, 10:31 AM
Hi A*C

Thanks for the script, however I still can't get it to work. I get an error line 1 character 1 object expected.

<script language="javascript">

function picture(pic){
var no=" addrbar=0,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizeable=0,"no+="width=720,height=576"

var mywin=window.open("","def",no)

mywin.document.write("<center><img src='"+pic+"'>")
mywin.document.write("<BR><BR><BR>")
mywin.document.write("<input type='button' value=' Close Window ' onclick='javascript:window.close()'>")

}
</script>
</head>

<body>

<tr><td><p><a href="javascript:picture('pic1.bmp')"><img src="tn_pic1.jpg" width="80" height="64"></a></p></td></tr>

I am linking from a thumbnail image, will this effect the code?
Although I did try with you click here link as well and I received the same error.

Hope you can see what I am doing wrong.

The javascript is all one word in all cases but for some reason in here it seperates it out.

Thanks

ACJavascript
06-22-2002, 06:06 PM
okay well i see somthing that might be causing the error

--------
how it is now
---------

var no="addrbar=0,toolbar=0,location=0,directories=0,statu
s=1,menubar=0,scrollbars=0,resizeable=0,"no+="width=720,height=576"

----------
should be, Each no+= has to be on there own line
----------
var no=" addrbar=0,toolbar=0,location=0,directories=0,"
no+="status=1,menubar=0,scrollbars=0,resizeable=0,"
no+="width=720,height=576"


Linking with an image isn't a problem at all. Its quite neet actualy:D:D

ginataylor50
06-22-2002, 06:11 PM
Hi there A*C

Thanks a lot for responding again.. I am going to check it now and see if it works. I will post back the result..


Thanks a mill.. You are a *star*

ginataylor50
06-23-2002, 08:34 AM
A*C

What can I say.... YOU ARE THE KING... BRILLIANT.. !!

IT WORKS, YOU HAVE SAVED MY LIFE....

HOURS AND HOURS OF FRUSTRATION FIXED..

I can't thank you enough.

Have a great day... You really are a star.. *****

Thanks

ACJavascript
06-23-2002, 05:51 PM
It was my pleasure Gina :D:D:D:D:D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum