Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

image scrolling gallery (php/js)

  • 11-08-2008 10:35AM
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 Posts: 2,793 ✭✭✭oeb




  • Registered Users, Registered Users 2 Posts: 21,278 ✭✭✭✭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, Registered Users 2 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, Registered Users 2 Posts: 21,278 ✭✭✭✭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, Registered Users 2 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, Registered Users 2 Posts: 21,278 ✭✭✭✭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, Registered Users 2 Posts: 788 ✭✭✭sleepyescapade


    pm'd you


Advertisement