Jump to content

Load images


Fire Dragon
 Share

Recommended Posts

I want create page what contains information and pictures.Then,I want that there is button or something what triggers images (chosen ones) so you can see them.That's because user don't need load them if he/she don't want.What will be best way for this?I don't want create different page for images because then I must keep eye many many pages.What is your suggestion?

Link to comment
Share on other sites

Kinda hard to read your text... but I think I understand. You'll need any server side scripting language (ASP, PHP, coldfusion...) anyone of those. You create 1 page and store the img path and text in a DB.

Link to comment
Share on other sites

Or a JavaScript that would hide the desired images and show them when appropriate links/buttons are here, simillarly to scripts used for tree-like menus.However, such thing would let all images download, though the shown will be with priority, so a server side script is truly reccomended.

Link to comment
Share on other sites

There is no need for a server side language or db to do this :) , javascript is more than capable :( No need to hide images, image is only downloaded when you press the buttonPut the path of the image as the button idwhen button is pressed send it's id (image path) to a function function puts the id (image path) into the src of the blank image initially shown on the page.pic is then loaded and displayed, job done :)

<head><script>function changePic(newPic){  document.getElementById('mypic').src=newPic;}</script></head><body><h1>My page with no images pre-loaded </h1><p>Click the button to download the image</p><input type="button" value="Google" id="http://www.google.co.uk/intl/en_uk/images/logo.gif" onclick="changePic(this.id)" /><input type="button" value="Ebay" id="http://pics.ebaystatic.com/aw/pics/uk/logos/logoEbay_150x70.gif" onclick="changePic(this.id)" /><input type="button" value="W3Schools" id="http://w3schools.invisionzone.com/style_images/w3sbanner.gif" onclick="changePic(this.id)" /><br /><br /><img id="mypic" src="http://www.pmichaud.com/pmwiki/uploads/Cookbook/blank.jpg" /></body>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...