Solved

Thumbnail viewer w/close window button

Posted on 2002-07-28
15
342 Views
Last Modified: 2012-05-04
I am trying to have an image viewed from a thumbnail.

Problem is that the page I am coming from is an onload popup. When user clicks on the thumbnail they do get the larger image but when they "X" out of the new window created for the larger image it drops them out of the popup. I think I need a "Close Window" button on the thumbnail viewer page so it will get user back to the original (onload popup) page. Instead of closing the original popup page.

The (popup) page and website is at http://tchnet.cjb.net .

I have not been able to figure out how to add a "Close Window" button to a thumbnail viewer page, if thats the best way to go.

Thanks
0
Comment
Question by:READER
  • 6
  • 5
  • 3
  • +1
15 Comments
 
LVL 18

Expert Comment

by:bruno
ID: 7184320
hey that's a big page, where am i looking?
0
 
LVL 8

Expert Comment

by:bebonham
ID: 7185240
use an onunload code...

very simpe I guess

window.onunload=window.opener.focus
0
 
LVL 8

Expert Comment

by:bebonham
ID: 7185242
other wise if your situation is not as I understand it per my answer, you can explicity name the opener...or you can even do this same on lost focus, which might work too.

0
 
LVL 2

Author Comment

by:READER
ID: 7185566
bebonham

Thanks for response.

I'm a Javascript neophyte. Mostly use pre-written scripts.

Can you provide some more detail on how I would go about implementing your comment?

brunobear... You should get a popup when you go to http://tchnet.cjb.net . The popup page gets closed after you click on one of the thumbnail pictures. I want it to stay open so user can click on other pictures.
0
 
LVL 18

Expert Comment

by:bruno
ID: 7185587
ah, i msut have had scripting off before...

by the way, i'll never click that link again as i got a prompt to install Gator.


But what you are doing is just loading the actual picture into the popup window.  don't do this.

instead of linking to the picture, link to an HTML page that has the picture in it, so you can put a back button on the html page..


<a href="#" onclick="history.go(-1);">go back</a>



BRUNO
0
 
LVL 8

Expert Comment

by:bebonham
ID: 7185937



so you must make an html page for each image and on that page have
<SCRIPT>
window.onunload=window.opener.focus
</SCRIPT>
<IMG SRC="whatever">


sorry, I don't think there is any other way...
I tried some expeiments without using an html page...

like
dd=window.open(jpgname)
dd.onunload= --problem here--

so...
you will have to make the html pages
0
 
LVL 18

Expert Comment

by:bruno
ID: 7185970
or at least ONE html page, if you can use ASP it's easy to pass the image you want loaded at a parameter to the page, you can do it with javascript as well, but i don't know the lingo...


for ASP it would be like:


<%
imgFile = Request.Querystring("img")
%>


<img src="/images/<%=imgFile%>">

<br><br>

<a href="#" onclick="history.go(-1);">go back</a>



and the URL to get to the image would be like

<a href="image.asp?img=picture1.jpg"><img src="/images/picture1_thumbnail.jpg"></a>



hope that all makes sense


0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 2

Author Comment

by:READER
ID: 7186531
Creating seperate HTML pages for every picture sounds kind of onerous. (Don't want to do unless I am forced to)

Any chance you could have the thumbnail viewer (xthumbnail-orig-image) come up with a "Close window" button? Maybe using a style sheet or some additional parameters?

The tag I am using for the thumbnail is as follows:

<a href="TCccandrpic45b.jpg">
        <img border="0" src="TCccandrpic45b_small.jpg" xthumbnail-orig-image="TCccandrpic45b.jpg" width="137" height="106"></a>
0
 
LVL 18

Expert Comment

by:bruno
ID: 7186573
>>Creating seperate HTML pages for every picture sounds kind of onerous. (Don't want to do unless I am forced to)


did you not see my comment above where i said it could be done with ONE page, and even provided you with code?
0
 
LVL 2

Author Comment

by:READER
ID: 7186717
I don't know ASP (from a hole in the ground!!) {}:-)
0
 
LVL 18

Expert Comment

by:bruno
ID: 7186745
well, the same exact think can be accomplished with any server side scripting your server supports, OR javascript....i just don't know the javascript lingo, but SOMEONE here should!!!


BRUNO
0
 
LVL 2

Author Comment

by:READER
ID: 7186913
I found a javascript myself that solved the problem at
http://www.javascriptcity.com/scripts/new_submissions/usersub1012.htm

Its working great now. http://tchnet.cjb.net

Thanks for your help
0
 
LVL 18

Expert Comment

by:bruno
ID: 7187069
you can ask in CS for this to be resolved.  You can NOT however leave it open.
0
 
LVL 2

Author Comment

by:READER
ID: 7188333
I have asked CS to have this question deleted.

Thanks
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 7188500
Points refunded and placed in PAQ

Computert101
E-E Moderator
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now