Click to See Complete Forum and Search --> : Picture Generator problem


Dreams
12-08-2002, 08:26 PM
I'm not sure what this script is really called, but it's something that can be seen on this page (http://members.tripod.com/SSaturn/manga/saturnimages.htm), and I'd like to use it on my page. The problem is, I don't know if I can get the pictures to open in a new window? I've tried a few basic things, but I'm the type of person who cuts and pastes JS into my code, so I really don't understand the language.

I would like the images to open in a new window because once the viewer opens an image and then goes back to the page with the generator on it, the script reloads itself from the beginning. So this makes it hard to see each picture in sequence without continuing to go through ALL of the pictures.

If someone can help me, I'd really appreciate it.

Oh yes, and I did notice the creator's email in the script, and I've emailed him but gotten no response.

Thank you,
Dreams

Beach Bum
12-08-2002, 11:05 PM
looks to me like you could change the function:

function changeLink()
{
document.location = links[i]
}

to use a window.open instead. try:

window.open(links[i],"image",width="x",height="x")

i think that will work. you may need to play around with it some.

Dreams
12-08-2002, 11:27 PM
Thanks for telling me about the "window.open" part! I tried it out and it does work in opening the window, but it refuses to scroll. So I searched for more on "window.open" and I came up with:

function changeLink()
{
window.open(links[i],null,"height=390,width=550,status=yes,toolbar=no,menubar=yes,location=yes,scrollbar=yes,resizable=yes");
}

Everything works but the scrollbar. It's really puzzling me.

vickers_bits
12-09-2002, 06:16 AM
scrolling=auto
or just leave it out, i think

Dreams
12-10-2002, 01:23 AM
I hate to say this, but neither of those suggestions worked. I can't understand why all the other options work, but not the scrollbar. Is it not reading it as a picture or something, thinking it's a background?

hfraser
12-10-2002, 01:49 AM
try this this way your window wil even be formated with background color and all
and the image will be centered ! hey you can even tweak and add you own html!



function changeLink(){
// build it the way you want your window to be
newwindow=window.open("","imageWindow","width=400,height=400,status=yes,toolbar=no,menubar=no,location=no,scrollbar=yes,resizable=yes");

newwindow.document.write("<html><head></head><body bgcolor='#FFFFFF'><center>");
newwindow.document.write("<img src='"+links[i]+"'>" );
newwindow.document.write("</center></body></html>");
newwindow.document.close();
}

Dreams
12-10-2002, 11:05 PM
Your tag worked, the image is centered and it finally scrolls!
The only thing I had to add was "links[i],null," in the parenthesis at the beginning of the newwindow=window.open line.

But thanks! And thanks to everyone else for trying!