Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 450
  • Last Modified:

slide show not working correctly

Check this out: http://www.sharonfarber.com/index2.html

The images in the slide show repeat 1, 3, 1, 2 - it's not in order.  Can you help me to fix it please?

here is the code for the slider:

<section id="container">
    <div id="slideshow"> <img src="images/a_sfSlideweb.jpg" alt="Slideshow Image 1" class="active" /> <img src="images/b_sfSlideweb.jpg" alt="Slideshow Image 2" class="active" /><img src="images/c_sfSlideweb.jpg" alt="Slideshow Image 3" class="active" /><img src="images/d_sfSlideweb.jpg" alt="Slideshow Image 4" class="active" /> <img src=
"images/e_sfSlideweb.jpg" alt="Slideshow Image
5" class="active" /> <img src="images/f_sfSlideweb.jpg" alt="Slideshow Image 6" class="active" /> <img src="images/g_sfSlideweb.jpg" alt="Slideshow Image 7" class="active" /> <img src="images/h_sfSlideweb.jpg" alt="Slideshow Image 8" class="active" /> <img src="images/i_sfSlideweb.jpg" alt="Slideshow Image 9" class="active"/> <img src="images/a_sfSlideweb.jpg" alt="Slideshow Image 10" class="active"/> <img src="images/k_sfSlideweb.jpg" alt="Slideshow Image 11" /></div>
0
Revolution9
Asked:
Revolution9
  • 4
  • 3
  • 2
  • +1
1 Solution
 
Tom BeckCommented:
Remove class="active" from all of the image tags except for the first one.
0
 
Jason C. LevineNo oneCommented:
That's the HTML for the images.  The actual slide show code is probably JavaScript...can you post that?
0
 
Revolution9Author Commented:
I took off the class="active" and thought it was working, then migrated the page to index.html (www.sharonfarber.com) - but it looks like it is not bringing up the second slide (b_sfSlideweb.jpg).  Here is the revised code.

<section id="container">
    <div id="slideshow"> <img src="images/a_sfSlideweb.jpg" alt="Slideshow Image 1" class="active" />
    <img src="images/b_sfSlideweb.jpg" alt="Slideshow Image 2"/>
    <img src="images/c_sfSlideweb.jpg" alt="Slideshow Image 3"/>
    <img src="images/d_sfSlideweb.jpg" alt="Slideshow Image 4"/>
    <img src="images/e_sfSlideweb.jpg" alt="Slideshow Image 5"/>
    <img src="images/f_sfSlideweb.jpg" alt="Slideshow Image 6"/>
    <img src="images/g_sfSlideweb.jpg" alt="Slideshow Image 7"/>
    <img src="images/h_sfSlideweb.jpg" alt="Slideshow Image 8"/>
    <img src="images/i_sfSlideweb.jpg" alt="Slideshow Image 9"/>
    <img src="images/j_sfSlideweb.jpg" alt="Slideshow Image 10"/>
    <img src="images/a_sfSlideweb.jpg" alt="Slideshow Image 11"/></div>
  </section>
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Tom BeckCommented:
Are you sure about that? I look at the view source for the rendered page at sharonfarbor.com and I see that the first THREE images have class="active".
0
 
Revolution9Author Commented:
That's weird.  Here is the complete page code.  Maybe you can find out from this what's going on:


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Sharon Farber - Composer</title>
<link rel="image_src" href="http://sharonfarber.com/images/homestudio.jpg" />
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/player-mini.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/js/jquery.jplayer.min.js"></script>
<script type="text/javascript">
function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
</script>
<script type="text/javascript">
$(document).ready(function() {
    setInterval( "slideSwitch()", 7000 );
    if (navigator.userAgent.match(/i(Pad|Phone|Pod)/i) != null) {
        $('.volume-bar-holder').remove();
        $('#player-mini').css('width', '235px');
        $('#player-mini').css('margin-right', '30px');
    }
    $('#player-instance').jPlayer({
        ready: function() {
            $(this).jPlayer('setMedia', {'mp3': 'audio/home.mp3', 'oga': 'audio/home.ogg'}).jPlayer("play");
        },
        supplied: 'ogg, mp3',
        solution: 'html, flash',
        wmode: 'window',
        preload: 'metadata',
        swfPath: 'js/Jplayer.swf',
        cssSelectorAncestor: '#player-mini'
    });
});
</script>
</head>
<body>
<div id="wrapper"> 
  <!-- header start -->
  <header>
    <div class="logo_block">
      <h1 class="lefts">Sharon Farber composer</h1>
    <nav>
        <ul>
          <li><a href="index.html" class="active">home</a></li>
          <li><a href="news.html">news</a></li>
          <li><a href="#" >music</a>
            <ul>
              <li><a href="filmgallery.html">film/tv</a></li>
              <li><a href="#">concert</a>
                <ul>
                  <li><a href="orchestral.html">orchestral</a></li>
                  <li><a href="chorale.html">chorale</a></li>
                  <li><a href="artsongs.html">art songs</a></li>
                </ul>
              </li>
              <li><a href="miscellaneous.html">miscellaneous film cues</a> </li>
            </ul>
          </li>
          <li><a href="video.html">video</a></li>
          <li><a href="bio.html">bio</a></li>
          <li><a href="credits.html">credits</a></li>
          <li><a href="gallery.html">gallery</a></li>
          <li><a href="press.html">press</a></li>
          <li><a href="blog.html">blog</a></li>
          <li><a href="store.html">store</a></li>
          <li><a href="contact.html">contact</a>
        </ul>
      </nav>
    </div>
  </header>
  <!-- header end --> 
  <!-- body start -->
  <section id="container">
    <div id="slideshow"> <img src="images/a_sfSlideweb.jpg" alt="Slideshow Image 1" class="active" /> 
    <img src="images/b_sfSlideweb.jpg" alt="Slideshow Image 2"/>
    <img src="images/c_sfSlideweb.jpg" alt="Slideshow Image 3"/>
    <img src="images/d_sfSlideweb.jpg" alt="Slideshow Image 4"/> 
    <img src="images/e_sfSlideweb.jpg" alt="Slideshow Image 5"/> 
    <img src="images/f_sfSlideweb.jpg" alt="Slideshow Image 6"/> 
    <img src="images/g_sfSlideweb.jpg" alt="Slideshow Image 7"/> 
    <img src="images/h_sfSlideweb.jpg" alt="Slideshow Image 8"/> 
    <img src="images/i_sfSlideweb.jpg" alt="Slideshow Image 9"/> 
    <img src="images/j_sfSlideweb.jpg" alt="Slideshow Image 10"/> 
    <img src="images/a_sfSlideweb.jpg" alt="Slideshow Image 11"/></div>
  </section>
  <!-- body end --> 
  <!-- footer start -->
    <footer>
        <span class="copyright lefts">&copy;2014 Sharon Farber  •  Website design by Richard Stellar / <a href="http://www.interstellar9.com/" target="_blank">Interstellar9</a></span>
        <span class="rights">
            <a href="http://www.facebook.com/sharon.farber.9" class="social_link" target="_blank"><img src="images/facebook.png" alt=""></a>
            <a href="https://twitter.com/shashscore" class="social_link" target="_blank"><img src="images/twitter.png" alt=""></a>
            <a href="http://www.linkedin.com/pub/sharon-farber/3/470/642" class="social_link" target="_blank"><img src="images/linkedin.png" alt=""></a>
            <a href="http://www.youtube.com/user/sharonfarbercomposer" class="social_link" target="_blank"><img src="images/you-tube.png" alt=""></a>
            <a href="http://www.imdb.com/name/nm0004283/" class="social_link" target="_blank"><img src="images/imdb.png" alt=""></a>
        </span>
        <div id="player-instance"></div>
        <div style="float: right; margin: 2px 10px 0 0;">
            <div id="player-mini">
                <div class="buttons-holder">
                    <div class="jp-play"></div>
                    <div class="jp-pause"></div>
                </div>
                <div class="bar-holder">
                    <div class="jp-seek-bar"><div class="jp-play-bar"></div></div>
                </div>
                <div class="time-holder">
                    <div class="jp-current-time">00:00</div>
                </div>
                <div class="volume-bar-holder">
                    <div class="jp-volume-bar"><div class="jp-volume-bar-value"></div></div>
                </div>
            </div>
        </div>
        <span id="audio_player" style="width: 0px;"></span>
    </footer>
  <!-- footer end --> 
</div>
</body>
</html>

Open in new window

0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
This file is missing http://www.sharonfarber.com/images/e_sfSlideweb.jpg and that may mess things up.   Try adding it and see if that works.

Otherwise, looking at the console as it looks like the js must be taking care of the "active"
0
 
Revolution9Author Commented:
I did, but it still appears that the images are not in order.  Thanks so much for your help.
0
 
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
It seems to work for me.  Your first and last slide are the exact same image.  The 4th(d) and 10th(j) are very similar
0
 
Tom BeckCommented:
Looks like it's working fine although the last slide should be "k" instead of "a". Then it will appear to run smoothly with equal amount of time spent at each slide. If you watch the slides change on the HTML tab in Firebug you will see that they are changing in perfect order.
0
 
Revolution9Author Commented:
thanks!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now