1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

can you guide me through making this gallery please?

Discussion in 'Content Management' started by belledumonde, Jun 11, 2006.

  1. #1
    can somebody guide me through making this simple gallery. i uploaded the one page so that its easier to see. after my frustration with iframes, i've decided to go with an open window approach which i think utilizes both javascript and PHP. what i'd like... is this:

    1. when you click on a thumbnail, a new window will appear (height: 610px, width: 550px) showing the enlarged photo.
    2. the position of the new window will be at the center of the screen.
    3. the new window will also have a set of thumbnails at the top in a horizontally scrolling div or ideally, with an arrow button on the left to scroll left and the same for the right. (no button for "next photo" or "last photo")
    4. each photo will be accompanied by a caption which will show above the photo under the thumbnails.
    5. clicking on the thumbnails in the new open window will display the enlarged photo with its caption.
    6. each photo will only be loaded once clicked on, dont need all photos to download before the page to be functional.
    7. if the photo is wider than the window, a scrolling bar will appear and scrolls only the photo, not the whole page.
    8. a "close window" button will be at the bottom.

    http://samplegallery.awardspace.com/GalleryMain.php

    i know how to open a new window with javascript, specifying the size etc. but i still dont understand how to do the photo thing where you call up the right photo and caption. i also dont know how to get the right image to appear in the new window depending on which thumbnail is clicked first without creating a seperate page for every photo which is the exact thing im trying to avoid.

    all this scripting is so confusing to me. i'd really appreciate any help. :) :)

    (the linked photos are not the final ones btw, those ones will be 600px tall and have higher resolutions.)
     
    belledumonde, Jun 11, 2006 IP
  2. PinoyIto

    PinoyIto Notable Member

    Messages:
    5,863
    Likes Received:
    170
    Best Answers:
    0
    Trophy Points:
    260
    #2
    You can do the above task using javascript.... use array so that you can easily identify pictures with their captions....
     
    PinoyIto, Jun 12, 2006 IP
  3. belledumonde

    belledumonde Peon

    Messages:
    80
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    um, that doesnt really help me out. i have no idea how to do it, so i wouldnt know what array is. should put this post in javascript instead of php? i thought this task would involved some php too...?
     
    belledumonde, Jun 12, 2006 IP
  4. PinoyIto

    PinoyIto Notable Member

    Messages:
    5,863
    Likes Received:
    170
    Best Answers:
    0
    Trophy Points:
    260
    #4
    Here is simple way to use the array in javascript

    var pic= new Array(5)
    pic[0]="pic1.jpg";
    pic[1]="pic2.jpg";
    pic[2]="pic3.jpg";
    pic[3]="pic4.jpg";
    pic[4]="pic5.jpg";

    var caption = new Array(5)
    caption[0] = "caption for pic 1";
    caption[1] = "caption for pic 2";
    caption[2] = "caption for pic 3";
    caption[3] = "caption for pic 4";
    caption[4] = "caption for pic 5";


    so if you want to show picture 1..
    example:

    images[0].src=pic[0];
    write(caption[0]);
     
    PinoyIto, Jun 12, 2006 IP