954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

opening pictures in a new window

i signed up to daniweb a few weeks ago when i was having problems with visual basic which after a lot of searching on google i managed to solve for myself. i am now having a go at building a website and have been using dreamweaver which makes things very simple to achieve while i'm still learning how to html works.
i have put some of my photos on one of the pages and i have been trying to go from clicking on a thumbnail to opening a new small window containing a bigger picture. i realised from studying the source code of other websites that do this that i needed to use javascript but i have been having trouble finding something that works properly in firefox and ie (i am using ie7 if it matters). when you click on one of the thumbnails eg: the picture of a lorry on http://www.fieryidris.co.uk/Pictures/InterestingLorry.htm the new window opens with the bigger picture but then continues 'thinking' even when all of the picture is loaded.
i lifted the javascript code from another website so i don't completely understand it ,i can see that it is controlling the size and appearance of the new window , but there is also a random math bit i'm not sure what that does?
is there something i need to add to the javascript code to make the new window stop saying 'transferring data from www.fieryidris.co.uk ' or have i used some rubbish javascript and need to use a different javascript?

fieryidris
Newbie Poster
13 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

Your function needs a "document.close()" statement.

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 
Your function needs a "document.close()" statement.


thankyou for your reply.
i had found a mention of document.close() somewhere else yesterday evening but i can't work out where i should add it to the javascript?

fieryidris
Newbie Poster
13 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

Add it to the end of the function that writes the HTML into the new window. It can be the next statement after the final document.write().

tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 
fieryidris
Newbie Poster
13 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 
tgreer
Made Her Cry
Team Colleague
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
 

thankyou it is working nicely now.

it was the iwin bit that i had missed out.

fieryidris
Newbie Poster
13 posts since Aug 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You