Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

image scrolling gallery (php/js)

Options
  • 11-08-2008 10:35am
    #1
    Registered Users Posts: 788 ✭✭✭


    I need some advice on making an image scrolling gallery to insert on an index page. I want something like the demo on here ideally but their actual code wouldn't work (for me, anyway). I need to insert the images dynamically. I already googled "image scrolling gallery" but found no matches that suited what I am after. Just wondering if anyone on here has any advice on ideas. Thank you :)


Comments

  • Registered Users Posts: 2,793 ✭✭✭oeb




  • Registered Users Posts: 21,242 ✭✭✭✭Eoin


    Why won't it work for you? Seems like it would be easy enough to make dynamic.
    <nobr id="trueContainer">
    <!-- start PHP loop here -->
    <a href="javascript:enlargeimage('dynamicbook1.gif')"><img src="dynamicbook1.gif" <border=1></a> 
    <!-- End loop here-->
    </nobr>
    


  • Registered Users Posts: 788 ✭✭✭sleepyescapade


    eoin_s wrote: »
    Why won't it work for you? Seems like it would be easy enough to make dynamic.
    <nobr id="trueContainer">
    <!-- start PHP loop here -->
    <a href="javascript:enlargeimage('dynamicbook1.gif')"><img src="dynamicbook1.gif" <border=1></a> 
    <!-- End loop here-->
    </nobr>
    

    Yeah I did that, but it didn't display great. This was my code
    <?php
      mysql_connect("$DBHost","$DBUser","$DBPass");
     $result=mysql("$DBName","SELECT * FROM gallery");
    while($row=mysql_fetch_row($result)) {
     $pid=$row[0];
     
    echo"<a href=\"javascript:enlargeimage('images/gallery_images/$pid-1.jpg')\">
    <img src=\"images/gallery_images/$pid-1.jpg\" border=1></a> 
    <a href=\"javascript:enlargeimage('images/gallery_images/$pid-1.jpg', 300, 300)\">
    <img src=\"images/gallery_images/$pid-1.jpg\" border=1></a> <a href=\"gallery.html?id=$pid\">";
    
    }
    ?>		
    


  • Registered Users Posts: 21,242 ✭✭✭✭Eoin


    Try this on its own first:

    [php]echo"<a href=\"javascript:enlargeimage('images/gallery_images/$pid-1.jpg')\">
    <img src=\"images/gallery_images/$pid-1.jpg\" border=1></a> "[/php]

    You seem to have an open link tag, and I think you are duplicating each image also.


  • Registered Users Posts: 788 ✭✭✭sleepyescapade


    eoin_s wrote: »
    Try this on its own first:

    [php]echo"<a href=\"javascript:enlargeimage('images/gallery_images/$pid-1.jpg')\">
    <img src=\"images/gallery_images/$pid-1.jpg\" border=1></a> "[/php]

    You seem to have an open link tag, and I think you are duplicating each image also.

    Thanks I tried that but it comes up blank. However in the page source it shows up
    					<nobr id="trueContainer">
    <a href="javascript:enlargeimage('images/gallery_images/1-1.jpg')">
    <img src="images/gallery_images/1-1.jpg" border=1></a> <a href="javascript:enlargeimage('images/gallery_images/2-1.jpg')">
    <img src="images/gallery_images/2-1.jpg" border=1></a> <a href="javascript:enlargeimage('images/gallery_images/3-1.jpg')">
    <img src="images/gallery_images/3-1.jpg" border=1></a> <a href="javascript:enlargeimage('images/gallery_images/4-1.jpg')">
    <img src="images/gallery_images/4-1.jpg" border=1></a> <a href="javascript:enlargeimage('images/gallery_images/5-1.jpg')">
    <img src="images/gallery_images/5-1.jpg" border=1></a> <a href="javascript:enlargeimage('images/gallery_images/6-1.jpg')">
    
    <img src="images/gallery_images/6-1.jpg" border=1></a> <a href="javascript:enlargeimage('images/gallery_images/7-1.jpg')">
    <img src="images/gallery_images/7-1.jpg" border=1></a> 
    </nobr>
    


  • Advertisement
  • Registered Users Posts: 21,242 ✭✭✭✭Eoin


    That part looks fine - I think the problem is elsewhere on the page. If you can't give a link, can you post up the full markup of the page?


  • Registered Users Posts: 788 ✭✭✭sleepyescapade


    pm'd you


Advertisement