Really need some help

E

Erik

I have a page with about 100 thumb nails that each shows a small page.
I would like to have a global command in the page with all the thumbs
that would make it so that when I push on the thumb nail on that page
the link is show in a pop up.

Something similar to this would be nice but as a global command as it
is not feasible to rewrite all the links.

<a href='http://eriksworld.altervista.org/pages/ghost_jpg.php'
target='_blank' onClick='window.open("http://eriksworld.altervista.org/pages/ghost_jpg.php","","width=700,height=600,resizable=no,scrollbars=no");
return false;'>Next</a>

All the best Erik
Sweden
 
J

Janne Raiskila

I hope i understrood correctly...

<script language=javascript>
<!--
function openPopUp(image) {
popup = window.open(image,"","width=500, height=500");
popup.setTitle("Image preview");
}
-->
</script>

<a href="image.jpg" onClick="openPopUp(image = this.href); return
false;">link1</a>
<a href="image2.jpg" onClick="openPopUp(image = this.href); return
false;">link2</a>

something like that
 
L

Lasse Reichstein Nielsen

Janne Raiskila said:
I hope i understrood correctly...

<script language=javascript>

This should be

HTML comments are not necessary in Javascript.
function openPopUp(image) {
popup = window.open(image,"","width=500, height=500");

I would make popup a local variable, i.e., start with "var popup =".

There should be no spaces in the configuation string. Some browsers
refuse to work with that.
popup.setTitle("Image preview");

I don't believe window objects have a setTitle method. The page in the
new window has (most likely) not been loaded yet when this statement
is executed, so functions on the page will not be loaded yet.
<a href="image.jpg" onClick="openPopUp(image = this.href); return

Drop "image = ", unless you need to put the href into a global
variable on this page.
something like that

Something like it :)
 
E

Erik

I was not too concise with my question. What I am asking is how I make
all the links on my page open up in a pop-up with out having to change
each of the links I have on my page.


All the best Erik

www.eriksworld.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top