www.webdeveloper.com
Results 1 to 7 of 7

Thread: send image from one page to another

  1. #1
    Join Date
    Aug 2012
    Location
    Brighton UK
    Posts
    8

    send image from one page to another

    Hi everyone,
    I have a catalogue page with a list of images. Each image has a rollover pop up offset larger image. I now want to send the image when clicked to another page to display as a larger image. I think this can be done using the get elementbyid(image)src. but I am not sure of the syntax. Once the image and source have been identified I would like to know a good way of showing it in the other page as a larger image. Can anyone help please?

  2. #2
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114
    You can just use a regular hyperlink... Unless I'm missing something.

  3. #3
    Join Date
    Aug 2012
    Location
    Brighton UK
    Posts
    8
    Quote Originally Posted by donatello View Post
    You can just use a regular hyperlink... Unless I'm missing something.
    Hi donatello,
    a regular hyperlink would go something like <href anotherpage?name of image /a> could you eleborate for me please. I have a list of images and when one is clicked i want it to be displayed as a larger image in another page. But I only want to use one page for the larger image to display, so that when a different image is clicked then just that image is passed. sorry if this is a bit vague, i hope you understand what I'm trying to do, can you help? thanks

  4. #4
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114
    Post some code and it will be more clear.

    HTML Code:
    <a href="/images/myimage.jpg"><img src="/images/myimage.jpg" border="0" /></a>

  5. #5
    Join Date
    Aug 2012
    Location
    Brighton UK
    Posts
    8
    Quote Originally Posted by donatello View Post
    Post some code and it will be more clear.

    HTML Code:
    <a href="/images/myimage.jpg"><img src="/images/myimage.jpg" border="0" /></a>
    Hi Donnatello,
    Can the a href direct to another page (largerpic.html?image_id=1234&<img src="/images/myimage.jpg" border="0" /></a>

    thats what I am trying to do. I know each image id and could hyper link each one acordingly, but I'm not sure that the href can have =<img src=

    confused.
    Bruce

  6. #6
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,114
    You don't have to do it like that, you can simply use an anchor tag (< a>) to link to an image directly if that is what you wish to do.

    Also, reconsider renaming your images with something more Search Engine friendly than img2334 or some such, better puppy-dog.jpg than img22334.jpg


    Post some sample code and it will be easier to help.
    You can experiment on jsfiddle (http://jsfiddle.net). That also makes it easy for me to modify your code and demo it.


  7. #7
    Join Date
    Aug 2012
    Location
    Brighton UK
    Posts
    8
    thanks Donatello but I think I am going to have to approach the problem from another angle using PHP and MySql. I've got wampserver installed and coffeetime editor. Thanks anyway
    Last edited by LennyOneStep; 08-20-2012 at 11:38 AM. Reason: unable to post folder or html pages

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles