Results 1 to 7 of 7

Thread: Javascript Image Viewer

  1. #1
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Javascript Image Viewer

    I am trying to re-create [Broken Link Removed] but when I run it, it opens one image then closes it automatically. Not sure what I am doing wrong.

    Code:
    <!DOCTYPE html>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    
    <meta http-equiv="X-UA-Compatible" content="IE=8" /> 
       <title>Slide Show</title>
        <link rel="stylesheet" href="backbox.css" type="text/css" />
    <script type="text/javascript" src="js/prototype.compressed.js"></script>
    <script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
    <script type="text/javascript" src="js/lightbox.js"></script>
    <script type="text/javascript" src="js/dhtmlHistory.js"></script>
    <script type="text/javascript" src="js/customsignsheader.js"></script>
        
    </head>
    <body>
    <div onclick="dhtmlHistory.add('location1',{message: 'backbox'});countdown()">
    <a href="images/babyhand.jpg" rel="lightbox[slide]" caption="A Bunch of Grapes">
    <img src="images/sunset.jpg" alt="lime" width="400" height="300" border="0" /></a>
    </div>
    
    <a href="images/desert.jpg" rel="lightbox[slide]" caption="Sunflower"></a>
    <a href="images/beech.jpg" rel="lightbox[slide]" caption="Dolphin"></a>
    <a href="images/lime.jpg" rel="lightbox[slide]" caption="Waterfall"></a>
    
    <script type="text/javascript" src="customsignsfooter.js"></script>
    </body>
    </html>
    Last edited by jscheuer1; 11-25-2014 at 12:31 AM. Reason: remove broken link

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The link to the demo page of the script that you posted was truncated (broken) so I removed it. What script exactly are you trying to use? Looks like some outdated version of lightbox (lightbox no longer uses Prototype/Scriptaculous).

    You might have better luck scrapping that and using the most recent version:

    http://lokeshdhakar.com/projects/lightbox2/
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    The link to the demo page of the script that you posted was truncated (broken) so I removed it. What script exactly are you trying to use? Looks like some outdated version of lightbox (lightbox no longer uses Prototype/Scriptaculous).

    You might have better luck scrapping that and using the most recent version:

    http://lokeshdhakar.com/projects/lightbox2/
    This is what I am trying to go for.
    http://www.javascriptkit.com/script/...box/#location1

    I am looking for some sort of image slider.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This time I'm leaving the broken link in your post so that you can see that it is broken. Please provide the actual link.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Alright, I've found a different link of what I am trying to go for http://flexslider.woothemes.com/index.html

    I've made my js file:
    Code:
    $(window).load(function() {
      $('.flexslider').flexslider({
        animation: "slide"
      });
    });
    Html
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Image Slider</title>
    </head>
    <body>
    <!-- Place somewhere in the <body> of your page -->
    <div class="flexslider">
      <ul class="slides">
        <li>
          <img src="slide1.png" />
        </li>
        <li>
          <img src="slide2.png" />
        </li>
        <li>
          <img src="slide3.png" />
        </li>
        <li>
          <img src="slide4.png" />
        </li>
      </ul>
    </div>
    
    </body>
    </html>
    But when I run it, my pictures show up and don't slide.

  6. #6
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I just linked my .js file and .css, now I get an error that the $ is undefined in this piece of code:

    Code:
    $(window).load(function() {
      $('.flexslider').flexslider({
        animation: "slide"
      });
    });

  7. #7
    Join Date
    Nov 2014
    Location
    On A Scottish Island
    Posts
    488
    Thanks
    0
    Thanked 62 Times in 58 Posts

    Default

    You need to have jQuery loaded to run that code.

Similar Threads

  1. Integrating Facebox Image Viewer with Carousel Viewer
    By button1 in forum Dynamic Drive scripts help
    Replies: 5
    Last Post: 12-11-2008, 12:26 AM
  2. Image Thumbnail Viewer II + javascript disabled accessibility
    By ramblingwebgirl in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 08-31-2008, 04:59 AM
  3. image thumbnail viewer II (set image sizes, default image)
    By ramtanion in forum Dynamic Drive scripts help
    Replies: 7
    Last Post: 05-07-2008, 12:26 AM
  4. Javascript Fade In/Out Image Viewer
    By uniquesole in forum JavaScript
    Replies: 2
    Last Post: 12-27-2007, 10:19 PM
  5. Combine Image Viewer and Image Viewer II
    By timmay9162 in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 06-04-2007, 08:26 PM

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
  •