Solved

slide show not working correctly

Posted on 2014-01-04
10
414 Views
Last Modified: 2014-01-05
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
Comment
Question by:Revolution9
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
ID: 39756520
Remove class="active" from all of the image tags except for the first one.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 39756523
That's the HTML for the images.  The actual slide show code is probably JavaScript...can you post that?
0
 

Author Comment

by:Revolution9
ID: 39756596
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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 38

Expert Comment

by:Tom Beck
ID: 39756628
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
 

Author Comment

by:Revolution9
ID: 39756639
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
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39756641
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
 

Author Comment

by:Revolution9
ID: 39756646
I did, but it still appears that the images are not in order.  Thanks so much for your help.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39756668
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
 
LVL 38

Expert Comment

by:Tom Beck
ID: 39756801
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
 

Author Closing Comment

by:Revolution9
ID: 39757382
thanks!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
login jsp example 24 49
Can't find PHP files on account that has WordPress 3 27
Cannot center boxes on mobile, but looks good on desktop 9 31
Center div containing a script 6 16
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question