SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Dec 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Mouseover image won't load in the right image holder

    Anyone can help me with my code?

    If you look at my page
    vitrail-entete.com/tdj/quoi_de_neuf_test.php

    When you mouseover the thumbnails on each row all the larger images appear in the top image holder (the one in the first row).

    I'd like to have the images appear in the large image holder just above their thumbnail set

    Any idea ?

    I'm new with php, javascript.


    Javascript code...

    Code:
    function show_large_image(obj)
    {
     var large_image_obj = document.getElementById("image_holder");
     large_image_obj.src = obj.src;
     }
    Php code...

    Code:
    $result = mysql_query("SELECT * FROM AlbumTable WHERE AlbumCategorie = 'Que se passe t-il' order by AlbumId DESC");
    while($row = mysql_fetch_assoc($result)) {
    
    
    //MY TITLE AND TEXT TABLE
    echo "<span class='style1'>";
    echo "<table border=0 width=510>";
    echo "<tr>";
    echo "<td align=center><b>$row[AlbumTitre]</b>";
    echo "</td>";
    echo "</tr>";
    
    echo "<tr>";
    echo "<td align=center>$row[AlbumTexte]";
    echo "<br><br>";
    echo "</td>";
    echo "</tr>";
    echo "</table>";
    
    //MY LARGE IMAGE HOLDER TABLE
    echo "<table border=0 width=510>";echo "<tr>";
    echo "<td align=center colspan=4>";
    echo "<img id='image_holder' border='1' width='400' height='300' src='images/transparent.gif' />";
    echo "</td>";
    echo "</tr>";
    echo "</table>";
    
    
    //MY THUMBNAILS TABLE
    $col = 0;
    echo"<center>";
    echo "<table border=0 width=210>";
    
    
    $AlbumId = $row[AlbumId];
    $result2 = mysql_query("SELECT * FROM PhotosTable WHERE PhotosId = '$AlbumId' order by Date DESC");
    while($row = mysql_fetch_assoc($result2)) {
    
    
    if ($col == 0)
    echo "<tr>";
    $PathG = '/' . 'tdj' . $row['PhotosPathG'];
    echo "<td align=center><img border='1' src='$PathG' onmouseover='show_large_image(this)' return false;\" width='100' height= 
    
    '70' />";
    echo "</td>";
    $col++;
    if ($col == 4)
    {
    echo "</tr>";
    $col = 0;
    }
    }
    
    echo "</table>";
    echo "</center>";
    echo"<br><br><br>";
    echo "</span>";
    }


    Anyone know the problem?
    Thanks in advance for your help

  2. #2
    SitePoint Evangelist Dave Morton's Avatar
    Join Date
    Sep 2003
    Location
    Carson City, NV
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The image holders have to have unique id's. Name each image holder "image_holder1", image_holder2", image_holder3", etc. and have the corresponding thumbnail images make a call to a function like: showFull("image_holder3", this) Where showFull gets the src attribute of the thumb, and places the full sized image in image_holder3

    This is more of a JavaScript question than PHP, by the way. If you have further questions about this, you may get more responses if you post there. I'm happy to help, but this is really the wrong forum.
    Making a difference, one little psychotic episode at a time
    Geek Cave Creations
    Beta testers needed for pChat
    Dave's Gallery

  3. #3
    SitePoint Member
    Join Date
    Dec 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh ok, I see what you mean. Sorry for the wrong section, it is my first post here. Thanks for your time and suggestions I'll give it a try.

    thanks again

  4. #4
    SitePoint Evangelist Dave Morton's Avatar
    Join Date
    Sep 2003
    Location
    Carson City, NV
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any time. We're all here to help each other. Let me know how it goes. Feedback is ALWAYS a good thing.
    Making a difference, one little psychotic episode at a time
    Geek Cave Creations
    Beta testers needed for pChat
    Dave's Gallery

  5. #5
    SitePoint Member
    Join Date
    Dec 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi!
    Sorry about that, I replied to this thread 1 hour ago saying that my problem is now solved but I dont know what happened, looks like my comment has not appeared.

    Anyway everything works fine now, thanks agaon for your time and help!


Bookmarks

Posting Permissions

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