click on smalll image & pop up with full size image.

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
itp
Forum Commoner
Posts: 67
Joined: Fri Jun 15, 2007 6:50 am

click on smalll image & pop up with full size image.

Post by itp »

I'm not sure if this is standard HTML or a bit of javascript but I would like to click
on thumbnail of image (created with height,width attributes of <img> tag) and
get a window to pop up with full size image. Same window each time if possible.

Can anyone point me in right direction?
witcos
Forum Newbie
Posts: 2
Joined: Tue May 12, 2009 8:41 am

Re: click on smalll image & pop up with full size image.

Post by witcos »

instead of going with pop up.. why cant you try jQuery light boxes it will be more user friendly and.. you will get plug ins if you surf


[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
Last edited by pickle on Tue May 12, 2009 9:53 am, edited 1 time in total.
Reason: Fixed spelling
itp
Forum Commoner
Posts: 67
Joined: Fri Jun 15, 2007 6:50 am

Re: click on smalll image & pop up with full size image.

Post by itp »

I saw that at DHTML site, but it is just going to be used to for on-line documentation for a handful of users. User has an html page with thumbnail view of screens , and clicks on screen to get larger view. I don't want documentation to be fancier than actual application. 8O
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: click on smalll image & pop up with full size image.

Post by pickle »

You can tie in a function to the onclick event of all the thumbnails. In that function, determine which image to show based on the thumbnail filename (using this.href in the function).

The window.open() function returns an identifier to the window. I think you can do it this way to make each click pop up in the same window (untested):

Code: Select all

function popupMaker()
{
  var href = this.href;
  if(myWindow)
    myWindow = window.open('put arguments here');
  else
    var myWindow = window.open('put arguments here');
}
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
itp
Forum Commoner
Posts: 67
Joined: Fri Jun 15, 2007 6:50 am

Re: click on smalll image & pop up with full size image.

Post by itp »

looks good . i'll try it out!
Post Reply