Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.open problem 1

Status
Not open for further replies.
Nov 7, 2004
15
0
0
US
I am displaying several images on a page and I would like to be able to click on the image and open a new window with no toolbar, no browser, no scrollbar, etc. I am not using a style sheet and it seems that all of the example code I find calls for that. Can someone please help me with this? I am sure I need some sort of function at the top of the page but how do you have the function and use that same function for several different images?
 
Glad it works.

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
ME TOO!!
I have one more question and hopefully this is the last.
Here is my link with my image...

<a href="water.html" onclick="window.open('warmsurf.html', 'WarmSurf', 'width=475, height=480');"><img src="images/water/warmsurf2.jpg" width="204" height="150" alt="" border="0"></a>

Now the page that this image is on is water.html. The popup that I want the image (warmsurf.jpg) to open is warmsurf.html. Is the href= supposed to be pointing to water.html?
 
Here is what it sould look like. Explanation at bottom:
Code:
<a href="[red]warmsurf[/red].html" onclick="[red]openWindow('warmsurf.html'); return false;[/red]"><img src="images/water/warmsurf2.jpg" width="204" height="150" alt="" border="0"></a>

I presume that you want to call the popup function when you click the image. The url in the href is for people with javascript disabled, and the return false is so the page does not get redirected.

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
Good.

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
Only problem I see is that the window is too small for the illuminated image and the caption.

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
Thanks, I found that one and there are a few others that have the same issue. Ms. Sherry would like me to allow for scrollbars so that people who view in 800X600 can see these better. I will have to have srollbars=yes and resizeable=yes in the script at the top, right??
 
s[red]c[/red]rollbars=yes and resizable=yes, yes (no e in resizable)

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
How come if I add the scrollbars=yes and the resizable=yes in the script at the top...

var newwin = window.open(url,"imagewindow","top=0,left=0,location=no,menubar=no,status=no,directories=no,scrollbars=yes,resizable=yes,toolbar=no");

I can't get it to work but if I add it in the window.open it does work??

window.open('warmsurf.html', 'WarmSurf', 'width=475, height=480, resizable=yes, scrollbars=yes'); return false;
 
Because you never actually call the function at the top. You can remove it if you want.

--Chessbot

"See the TURTLE of enormous girth!"
-- Stephen King, The Dark Tower series
 
hi, thanks so much for the question and the replies, i know nothing about programming, i wanted to have windows pop up at my photography website, there is one gallery in particular (the models portfolio gallery -if you want to look) which i am looking foreward to changing with this code -ty chessbot, but it raises a question for me...

my navigation is such that now folks who click on a thumbnail get a child(?) page and not a window, i kind of like that, it keeps the clutter down... there is a little arrow in the upper left hand corner
with the code

<a href="javeascript:history>go(-1)><img src="return.gif></a>


of course in a new window this won't work, is there some way i can fix this so it closes the window or goes back to the parent depending on whether or not the window is a child or a pop up?

thanks for reading all this
 
Call goBack when the button is clicked.
Code:
function goBack()
{
  if (!opener)
    history.go(-1);
  else
  {
    opener = self; // This is a hack to keep the user from 
    self.close();  // being asked if they want to close the page
  }
}

--Chessbot

"Violence is the last refuge of the incompetent." -- Asimov, Foundation
 
wow, that was fast, went to get a sandwich, hit refresh on a whim, thanks very much!!
 
[lol]
no problem.

--Chessbot

"Violence is the last refuge of the incompetent." -- Asimov, Foundation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top