Closed Thread Icon

Preserved Topic: Simple Pop-up question Pages that link to <a href="https://ozoneasylum.com/backlink?for=17914" title="Pages that link to Preserved Topic: Simple Pop-up question" rel="nofollow" >Preserved Topic: Simple Pop-up question\

 
Author Thread
Wakkos
Maniac (V) Mad Scientist

From: Azylum's Secret Lab
Insane since: Oct 2000

posted posted 01-11-2001 14:37

Hello, it´s me boring again.
How do i do if i have an image thumbnail and i want it to link to a big image but in a new windows, of the size of the image, i can use the javascript launchnow) doc´s code but i´ll have to crate "each" one of the html files for every image (are too many).
There´s not a simple way to just open the images in a new explorer window?
I mean, not to create each html file, just upload the images and open it when making click...
I know there´s a way, but i´m not programmer and i can´t remember how....


Thanks

Wes
Paranoid (IV) Mad Scientist

From: Inside THE BOX
Insane since: May 2000

posted posted 01-11-2001 18:42

Mmmm...Laticia...

Hmm? What? Oh, let's see. I don't know Doc's "launchnow," but, here's what I use, it's probably similar:

function createPopup(url)
{
Popup = window.open(url,"Popup","toolbar=no,width=400,height=400,directories=no,status=yes,scrollbars=yes,resizable=yes,menubar=no");
}

Then use the following for your link:

<A HREF="javascript:createPopup('image.jpg');"></A>

Where "image.jpg" is, you can put either an HTML document or an image. As for launching the window at the size of the image, I'm not sure how you would do that. The only way I know how to set it is in the function -- I can't figure out how to carry it those variables over from the link. (Anyone know a way?)

Incidentally, I'd like to take this opportunity to ask anyone who launches new windows like this to let the status bar remain. You can take everything else away, but I still like to know if anything is actually happening while I'm waiting for the content to load in the new window. Too often, I end up staring at a newly launched window that remains blank for too long and I can't tell if anything is actually going on.


mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 01-11-2001 20:36

I wrote a few tricks related to pop-up windows in this thread: http://www.ozoneasylum.com/Forum6/HTML/000288.html (Wes, you'll find there how to pass window width & height variables to function).

Pugzly
Paranoid (IV) Inmate

From: 127.0.0.1
Insane since: Apr 2000

posted posted 01-11-2001 21:22

And, you can use the GurusNetwork Window.Open Code Generator

Pat Richard
Web weenie
http://www.gurusnetwork.com
ICQ 23113317

TheTrixter
Bipolar (III) Inmate

From: Derbyshire, UK
Insane since: Jul 2000

posted posted 01-12-2001 08:09

WES, that looks like just the thing I was looking for as well. Cheers, man!
Just one more question. . . .

When the excellent pop-up window appears with the jpg specified in it. Is it possible to create a kind of default html page that has some text on it and then have the specified jpg appear in that page. If that makes any sense at all. So as to avoid making several different html pages to contain some text and an image ( as I have normally done, but takes too many pages)

Hope you can help

Wakkos
Maniac (V) Mad Scientist

From: Azylum's Secret Lab
Insane since: Oct 2000

posted posted 01-12-2001 15:50

Trix, i think that you can use this, that create a custom html file and variate only the image:


function popimage(imagesrc,winwidth,winheight){
var look='width='+winwidth+',height='+winheight+','
popwin=window.open("","",look)
popwin.document.open()
popwin.document.write('<title>Image Window</title><body><img src="'+imagesrc+'"></body>')
popwin.document.close()
}

and the link will look like this:

<a href="#" onClick="popimage('image.jpg',200,200);return false">pop</a>

It worked for me, thank to Wes for helping me!!!




Wes
Paranoid (IV) Mad Scientist

From: Inside THE BOX
Insane since: May 2000

posted posted 01-13-2001 04:04

Mr. Max, that's cool. I was trying something similar that didn't work; I didn't realize the +winHeight+ bit would work like that. Thanks.

BTW, I didn't read further than that, so someone may have added what I'm about to add. You mentioned adding <BODY ONLOAD="this.focus()"> to the document in the pop-up window to bring it back to the top if you load something new into it. Try using this in the pop-up function instead:

setTimeout('Popup.focus()',500);

Does the same thing and you only have to add it to the function, rather than every document that will load in the pop-up.


« BackwardsOnwards »

Show Forum Drop Down Menu