/    Sign up×
Community /Pin to ProfileBookmark

Help with Javascript:showimage

I am trying to figure this out. I am trying to open a window with a set background and header for use with different pictures. It is very hard to explain but you can see a sample of this javascript at [url]www.ehowa.com.[/url] The webmaster there makes it so when you click on a link to an image file a new window or page opens with his header and footer and that particular image in the middle. I think its amazing I cannot find ANY information on this and hope someone would help.

Thanks

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliOct 29.2003 — There are tonnes of scripts out there,here is one of those,the iamge is opened with the window sized to exactly same as th eimages,you can change that and add header and footer..

[url=http://www.webapplikations.com/pages/html_js/image_examples/OpenThumbnailImageFullSize.html]Click Here[/url]
Copy linkTweet thisAlerts:
@agminerOct 29.2003 — I have done something similar. From page one I open a new window with onclick ( I specify a window size and no tools or status) the on click gives an image name. The page specified in the window open parses the url for the img name . This page could have a header, footer or whatever.

Calling code:

Click on an image (could be text instead). These images are in a table for selecting what is to be viewed. The focus puts the new window on top and the return false keeps the calling page's postion from changing when moving to and from the calling window.

<a href="#" onClick="window.open('display.html?yourimagename.jpg','display_2','resizable,scrollbars,width=540,height=470').focus();return false;"><img src="yourimagename.gif" height="110" alt="yourimagedescription"></a>

Display page code:

<html>

<head>

<title>

Display Pics

</title>

<script language="JavaScript">

var idx = document.URL.indexOf('?'); /*parameters on this URL? */

var new_image = document.URL.substring(idx+1,document.URL.length);

</script>

</head>
<body bgcolor="#8080ff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">
<div align="center">


<script language="JavaScript">

document.writeln("<img src='"+new_image + "'>");

</script>

</div>
</body>

</html>


Of course you will use the colors and text to suit your needs.
Copy linkTweet thisAlerts:
@vonedaddyauthorOct 29.2003 — Im sorry but I cant get either one to work for me. Did you happen to check the example I gave?? agminer seems to have what I am looking for but I cant get it to work.
Copy linkTweet thisAlerts:
@agminerOct 29.2003 — Here is a page where I use the code

http://home.mchsi.com/~barrs/made/made.html

The display page code is a separate html page and the other code is placed in the main page. Hope this helps.
Copy linkTweet thisAlerts:
@vonedaddyauthorOct 29.2003 — Well i would like to say thanks before anything.. I appreciate your time and help. But I altered the code from your page (I hope you dont mind) to see if I can get it to work for my needs. Here is the code Im using.

<!doctype html public "-//w3c//dtd html 3.2//en">

<html>

<head>

<title>

Cards Made page 1

</title>

<meta name="GENERATOR" content="Arachnophilia 4.0">

<meta name="FORMATTER" content="Arachnophilia 4.0">

</head>

<body bgcolor="#8080ff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000">

<br>

<!script language="JavaScript">

<a href="#" onClick="window.open('display.html?alivia.jpg','display_2','resizable,scrollbars,width=540,height=470').focus();return false;">OK</a>

</body>

</html>

I have both html files and the image file in the same directory and everything works. Except the image will not show. It shows me a new window (PERFECT) but it only shows me the place holder for the image... The image does not load. Maybe you can check this code and let me know whats wrong. Thanks in advance.
Copy linkTweet thisAlerts:
@agminerOct 29.2003 — One of those quirks is that it won't work unless it is used from a web site. Upload it to a site them try it.?

Frustating to have to upload all the time to test it., but that is what I have to do (net and ie) both.
Copy linkTweet thisAlerts:
@vonedaddyauthorOct 29.2003 — Hey AGMINER... I am posting this for no other reason than to thank you kindly for all your help. I now have it working exactly the way I want it to. Without your help I would be pulling my hair out. I REALLY appreciate you taking the time to help me. Thanks again.
×

Success!

Help @vonedaddy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...