www.webdeveloper.com
Results 1 to 5 of 5

Thread: scrolling thumbnails

  1. #1
    Join Date
    Nov 2011
    Posts
    149

    scrolling thumbnails

    I have this code that shows pictures. I have 21 pic's in it. But the code will only allow 6 thumbnails. Can someone help me fix it that I can have more then 6 pictures. I think I need it to scroll. Thanks in advance

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <title>Simple and Effective Photo Gallery with HTML and JavaScript</title>
    
    <style type="text/css">
    body {
    background: #00546b;
    margin-top: 20px;
    }
     
    h3 {
    color: #eee;
    font-family: Verdana;
    }
     
    .thumbnails img {
    height: 80px;
    border: 4px solid #555;
    padding: 1px;
    margin: 0 10px 10px 0;
    }
     
    .thumbnails img:hover {
    border: 4px solid #00ccff;
    cursor:pointer;
    }
     
    .preview img {
    border: 4px solid #444;
    padding: 1px;
    height: 250px;
    }
    </style>
    
    
    </head>
    <body>
    
    <div class="gallery" align="center">
    
    
    <div class="thumbnails">
    <img onmouseover="preview.src=img1.src" id="img1"img src="patio/patio1.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img2.src" id="img2"img src="patio/patio2.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img3.src" id="img3"img src="patio/patio3.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img4.src" id="img4"img src="patio/patio4.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img5.src" id="img5"img src="patio/patio5.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img6.src" id="img6"img src="patio/patio6.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img7.src" id="img7"img src="patio/patio7.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img8.src" id="img8"img src="patio/patio8.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img9.src" id="img9"img src="patio/patio9.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img10.src" id="img10"img src="patio/patio10.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img11.src" id="img11"img src="patio/patio11.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img12.src" id="img12"img src="patio/patio12.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img13.src" id="img13"img src="patio/patio13.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img14.src" id="img14"img src="patio/patio14.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img15.src" id="img15"img src="patio/patio15.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img16.src" id="img16"img src="patio/patio16.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img17.src" id="img17"img src="patio/patio17.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img18.src" id="img18"img src="patio/patio18.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img19.src" id="img19"img src="patio/patio19.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img20.src" id="img20"img src="patio/patio20.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img21.src" id="img21"img src="patio/patio21.jpg" alt="Image Not Loaded"/>
    </div><br/>
    
    <div class="preview" align="center">
     <img id="preview" src="http://bit.ly/2rz3hy" alt="No Image Loaded"/>
     
    </div>
     
    </div> <!-- Close the gallery div -->
    
     
    </body>
    </html>

  2. #2
    Join Date
    Nov 2002
    Posts
    2,632
    What browser are you using? I tried FF, IE, and Chrome and I'm seeing places for 21 images.

  3. #3
    Join Date
    Nov 2011
    Posts
    149
    I know there all there, I see them as well. I would like them all in one row. not 2.

  4. #4
    Join Date
    Nov 2002
    Posts
    2,632
    Quote Originally Posted by Maxxxx View Post
    But the code will only allow 6 thumbnails. Can someone help me fix it that I can have more then 6 pictures.
    Quote Originally Posted by Maxxxx View Post
    I would like them all in one row. not 2.
    O.o

    Depending on the browser, they can be displayed in more than two rows. If you want them all in a single row, you need smaller images or the user will need to scroll sideways. If you want them in a single column, use "display:block" and then use floats to get the preview area to be higher up.

  5. #5
    Join Date
    Nov 2011
    Posts
    149
    I made my thumbnails a bit smaller and it looks good, How ever, when the page first pops up. there is a different image blow my thumbnails. I would like my first image to be in it's place. You will see a big blue image with a seven in the middle.


    <img id="preview" src="http://bit.ly/2rz3hy" alt="No Image Loaded"/>



    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <title>Simple and Effective Photo Gallery with HTML and JavaScript</title>
    
    
    
    
    
    <style type="text/css">
    
    
    
    
    body {
    background: #00546b;
    margin-top: 20px;
    }
     
    h3 {
    color: #eee;
    font-family: Verdana;
    }
     
    .thumbnails img {
    height: 60px;
    border: 4px solid #000;
    padding: 1px;
    margin: 0 10px 10px 0;
    }
     
    .thumbnails img:hover {
    border: 2px solid #00ccff;
    cursor:pointer;
    }
     
    .preview img {
    border: 4px solid #000;
    padding: 1px;
    height: 350px;
    }
    </style>
    
    
    </head>
    <body>
    
    <div class="gallery" align="center">
    
    
    <div class="thumbnails">
    <img onmouseover="preview.src=img1.src" id="img1"img src="patio/patio1.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img2.src" id="img2"img src="patio/patio2.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img3.src" id="img3"img src="patio/patio3.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img4.src" id="img4"img src="patio/patio4.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img5.src" id="img5"img src="patio/patio5.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img6.src" id="img6"img src="patio/patio6.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img7.src" id="img7"img src="patio/patio7.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img8.src" id="img8"img src="patio/patio8.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img9.src" id="img9"img src="patio/patio9.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img10.src" id="img10"img src="patio/patio10.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img11.src" id="img11"img src="patio/patio11.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img12.src" id="img12"img src="patio/patio12.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img13.src" id="img13"img src="patio/patio13.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img14.src" id="img14"img src="patio/patio14.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img15.src" id="img15"img src="patio/patio15.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img16.src" id="img16"img src="patio/patio16.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img17.src" id="img17"img src="patio/patio17.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img18.src" id="img18"img src="patio/patio18.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img19.src" id="img19"img src="patio/patio19.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img20.src" id="img20"img src="patio/patio20.jpg" alt="Image Not Loaded"/>
    <img onmouseover="preview.src=img21.src" id="img21"img src="patio/patio21.jpg" alt="Image Not Loaded"/>
    </div><br/>
    
    <div class="preview" align="center">
     <img id="preview" src="http://bit.ly/2rz3hy" alt="No Image Loaded"/>
     
    </div>
     
    </div> <!-- Close the gallery div -->
    
     
    </body>
    </html>

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