Slider Trouble

What's up with my code? It keeps saying there's a syntax error in line #4.
// JavaScript Document<script type="text/javascript">
$('.slider').each(function(index, element) {
    var $this = $(this),
   var $group = $this.find('.slide-group'), //Line 4
    var $slides = $this.find('.slide'),
    var buttonArray = [],
    var currentIndex = 0,
    var timeout,;
    // move() - Function to move the slides goes here
    function move(newIndex) {
        var animateLeft, slideLeft;
        advance()
        if ($group,is(':animated') || currentIndex === newIndex {
            return;
        buttonArray[currentIndex].removeClass('active');
        buttonArray[newIndex].addClass('active);
        if (newIndex > currentIndex) {
            slideLeft = '100%';
            animateLeft = '-100%';
        } else {
          slideLeft = '-100%';
          animateLeft = '100%;
        $slides.eq(newIndex).css( {slideLeft, display: 'block'} );
        $group.animate( {left animateLeft} , funation() {
            $slides.eq(currentIndex).css( {display: 'none'} );
            $slides.eq(newIndex).css( {left: 0} );
            $group.css( {left: 0} );
            currentIndex = newIndex;
    function advance () {
        clearTimeout()timeout;
        // Start timer to run an anonymous function every 4 seconds
        timout = setTimeout (function() {
            if {currentIndex < ($slides.length - 1)) {
                move(currentIndex + 1);
            } else {
                move(0);
            }, 4000);
    $.each($slides, function(index){
        // Create a button element for the button
        var $button = $()'<button type="button" class="slide-btn">&bull;</button>');
        if (index === currentIndex) {
            $button.addClass('active');
        $button.on('click', function() {
            move(index);
        }).appendTo('slide-buttons');
        buttonArray.push($button);
    advance();

Hi,
I think we are reading the same book, as I'm having almost the exact same issue with a bit of code from a book by Jon Duckett.  Here's the source code from the book, followed by my solution:
Source:
$('.slider').each(function(){
    var $this = $(this),
    var $group = $this.find('.slide-group'),
    var $slides = $this.find('.slide'),
    var buttonArray = [],
    var currentIndex = 0,
    var timeout;
Fix:
$('.slider').each(function(){
    var $this = $(this);
    var $group = $this.find('.slide-group');
    var $slides = $this.find('.slide');
    var buttonArray = [];
    var currentIndex = 0;
    var timeout;
I changed the end of each line to terminate in a semicolon instead of a comma and the warnings went away in Dreamweaver (and warnings also went away in Firebug for Firefox).  So... that answers your original question but, the code from the book I'm reading still didn't work as written.  If you are in fact working with code from Jon Duckett's book, make sure to wrap the provided HTML code inside another div with a class of "slider" and add wrap all your javascript inside of $(document).ready(function() {  // code  }); for it to actually work. At that point, it works fine.

Similar Messages

  • N96 Slider trouble

    my N96's slider s loose at the left corner as i dropped it and the nokia official said that it can be used like that and it wont harm or bring any prob to the mobile...Should i give this to the service compulsorily or can i use it....???????

    it's always better to avoid future problems. take it to a nokia care point , let them fix the slider and ask them to check the phone for any other damage that might've occured due to the drop "internal injuries ". As radical said you will have to pay for any repairs.
    Fear not those who argue but those who dodge

  • I am having troubles at the moment to make a slide show...the app closed unexpected. and I can not finish the work, plus, the music is not reproduced...

    I am having troubles at the moment of making slide show. specially when I want to chage the parameters. the app get closed. If I do not try to change the paramenters any way he music is not reproduced...I would like to download again the app, maybe it is corrupted...
    thanks

    There are 9 different versions of iPhoto and they run on 9 different versions of the Operating System. The tricks and tips for dealing with issues vary depending on the version of iPhoto and the version of the OS. So to get help you need to give as much information as you can. Include things like:
    - What version of iPhoto.
    - What version of the Operating System.
    - Details. As full a description of the problem as you can. For example, if you have a problem with exporting, then explain by describing how you are trying to export, and so on.
    - History: Is this going on long? Has anything been installed or deleted? - Are there error messages?
    - What steps have you tried already to solve the issue.
    - Anything unusual about your set up? Or how you use iPhoto?
    Anything else you can think of that might help someone understand the problem you have.

  • I am having trouble getting rid of the delay between slides I am using revolve and there is a delay between when one fades and the other appears

    I am having trouble getting rid of delay between slides.  I am Revolving from one to the other and it comes up blank in between slides.

    @vincepay 
    Here is a link to the drivers for the HP Colour LaserJet 3600 windows 7 drivers:
    HP Color LaserJet 3600 Series Printers World Wide Printing System - 64 bit driver for windows 7
    I am an HP employee.
    Say Thanks by clicking the Kudos Star in the post that helped you.
    Please mark the post that solves your problem as Accepted Solution

  • Music Trouble with Slide Show

    I have used the slide show many times and have always had success with adding music from iTunes easily.
    I have recently upgraded with the software update and included in that update was an iTunes update. I also updated the iPhoto recently, since creating the last slide show.
    Today I have been trying to create a new slide show and add some music that I added to iTunes specifically for the slide show. All I get is a spinning disk and no response in iPhoto. The computer is not 'frozen' and I can access and use other applications while the disk spins in iPhoto, but iPhoto is stalled. I have had to force quit several times.
    Any ideas? The iPhoto is 4.0.3 and the iTunes is 5.0.1. I am running on an eMac from last year.
    Thanks.

    It may mean that there's another preference file in your User Preferences folder that is incompatible with iPhoto. I ran across this troubleshooting method a while back.
    Trouble Shooting Preferences
    Go to HD/Users/Your_name/Library. Move the Prefs folder (in its entirety) to the desktop. Start iPhoto. Determine if problem is fixed.
    If the problem IS fixed, then go to the new Prefs folder that the OS will have created and open it up. Except for those items that are obviously not related, move the contents to the old Prefs folder on the desktop, replacing what had been there. When in doubt, move the item. The worst thing that can happen is a harmless "alert" message. Then, trash what remains of the new folder. Finally, move the old (but modified) Prefs folder back to the library.
    If the problem is NOT fixed, trash the new Prefs folder and move the old one back to its original location.
    Otherwise you might want to reinstall the 10.3.9 COMBO updater followed by a permissions repair and reinstall iPhoto 4 from scratch and update it. If you do reinstall V4 you'll have to delete the current application and all files with "iPhoto" in the file name that reside in the HD/Library/Receipts folder.

  • Having trouble adding music to slide shows

    I've always been able to add specific songs from itunes to a iphoto slide show. Now when I go to add music the viewer just lists my playslists but won't open to show songs in the playlist. My only option is to play the entire playlist. I am using Itunes 7 and Iphoto 6.
    Also, when I try to add music to a slide show in powerpoint, the view shows songs in my music folder, no playlists, and it only show some of the songs, naturally not the ones I want.
    Any suggestions?

    Try the free Audacity software (Google it) and convert the .MP3 files to .WAV files. .WAV are uncompressed and most Adobe products can handle them natively without the need for external codecs.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • HT201406 i have been having trouble my iphone 3gs doesn't work the slide to unlock is broken i have tired everything to get it open but it won't work please help me!

    i have been having trouble my iphone 3gs doesn't work the slide to unlock is broken i have tired everything to get it open but it won't work please help me!

    Basic troubleshooting steps are:  Restart, Reset, Restore,

  • I'm having trouble producing a "DVD with titles" from 4 slide shows.

    I have selected the slideshows and started the process to DVD in PSE. I found that PSE will only accept the slideshows as 1 group and will not let me add slideshows later (unsupported and/or codec missing). Some slides get turned through 90 deg when put into PSE and one photo is not accepted, even though it's in jpg format, which all the other photos are. Can't see why this should be.
    Initially tried to combine slideshows with vidoe project (which the help guide says is possibel), but find whichever way I start (slideshow or video) the adding format is considered as uncompatible. Can't see why there is a problem.

    Do you mean Premiere Elements? You can't make any kind of video DVD in PSE, only the horrid VCD format. PRE has its own forum, which is here:
    http://forums.adobe.com/community/premiere_elements
    and you'll get better answers to PRE questions there. Good luck!

  • Trouble adding iTunes songs to slide show displays

    When displaying a group of photos in a slide show (view photos in full screen), I am unable to use my iTunes songs. I know how to "browse" and add the sample music from my music files (and that works fine), but it won't work w/my iTunes songs. I click on the iTunes file and it shows me the artists. I can then click on the folder and choose one of the songs. However, when I try to "Select" or "Open" the song, the title of the song disappears and it reads "No items match your search".
    I am able to open and listen to my iTunes songs when I am not in PSE. I have PSE 7, and am new to PSE.
    Any suggestions would be appreciated.

    My guess is that your songs in iTunes are not in a file format that PSE can use - what format are they? And they might also have DRM (digital rights) restrictions.
    I suggest that you try using iTunes to burn an mp3 file of one of the songs that you wish to use and then try that mp3 file in the PSE slide show.

  • I'm Having trouble printing slides

    I'm trying to print out slide for school and I'm trying to get it in the layout where the paper is vertical and there are 6 slides to one page dispersed evenly and it's just not working. Does anyone know how to get it in that layout!!! Im using a mac pro and keynote 09!

    I have not been able to get this to work in Keynote. You can print 6 slides per page and have them dispersed evenly, but only horizontally (landscape). What I have found the easiest work around to be is, in Pages, set up a page that has 6 pictures Defined as Placeholders sized as spaced as you prefer. Then in Keynote, export to pdf and drag and drop into the pages doc. Then you can print the pages doc just like normal.

  • Trouble customizing theme images for resized slide

    I am working with Keystation_eclipse pro theme. I originally chose the 1280 X 720 slide resolution. But I am changing the height to 768 to work optimally with the resolution of my projector. When changed, the background image is scaled but the other "primary overlay" image remains at the 720 resolution. I took the the "primary overlay" image and scaled it to 768 in order to resolve the problem. But now the layout with primary overlay image on the background image is not properly aligned. I have no idea how to resolve this layout situation. Any ideas?
    click here to the problem image. You will see the gray bars are not pushed all they to the top as they are in the second image. The bottom bar is pushed halfway off the screen:
    http://www.balticsojourn.com/files/768_slide.jpg
    click here to see the original image:
    http://www.balticsojourn.com/files/normal_slide.jpg
    intel macbook   Mac OS X (10.4.9)  
    mini, 1.42 g4   Mac OS X (10.4.2)  
    mini, 1.42 g4   Mac OS X (10.4.2)  

    Brian, thanks for the tip. Going back to the Metrix inspector the options were greyed out and so I can't change the coordinates. PLease see link below to see screenshot of the inspector window.
    http://www.balticsojourn.com/files/Picture1.png
    Mac mini (PPC); MacBook   Mac OS X (10.4.9)  

  • Having trouble with spry image slide show

    Im new to dw and i inserted a image slide show into my index.htm file, it works fine when i preview it in dw cs5.5.  When I try it on a web browser I get a dialog box that says that the spry panel selector .js requires spry widget.js and continues thru several other dialog boxes until my website loads only to see my image slideshow as a list.  Im not sure if its in the code or the support files can anyone help?  I would greatly appreciate it if someone can set me on the right path with this, Thank you in advance.
    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Pats IGA Supermarket</title>
    <link href="main.css" rel="stylesheet" type="text/css" />
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryDOMUtils.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryDOMEffects.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryWidget.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryPanelSelector.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryPanelSet.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryFadingPanels.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SprySliderPanels.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryFilmStrip.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryImageLoader.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/SpryImageSlideShow.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/plugins/ImageSlideShow/SpryThumbnailFilmStripPlugin.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/plugins/ImageSlideShow/SpryTitleSliderPlugin.js" type="text/javascript"></script>
    <script src="Spry-UI-1.7/includes/plugins/ImageSlideShow/SpryPanAndZoomPlugin.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    body {
        background-color: #9D5F16;
    </style>
    <link href="Spry-UI-1.7/css/ImageSlideShow/basicFS/basic_fs.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    /* BeginOAWidget_Instance_2141543: #frontpageslideshow */
    #frontpageslideshow {
        width: 951px;
        margin: 0px 0px 0px 0px;
        border: solid 0px #aaaaaa;
        background-color: #FFFFFF;
        padding-top: 0px;
    #frontpageslideshow .ISSName {
        top: -24px;
        font-family: Arial, Helvetica, sans-serif;
        font-weight: normal;
        font-size: 18px;
        text-transform: uppercase;
        color: #AAAAAA;
    #frontpageslideshow .ISSSlideTitle {
        top: -18px;
        font-family: Arial, Helvetica, sans-serif;
        font-weight: normal;
        font-size: 12px;
        overflow: hidden;
        color: #AAAAAA;
        text-transform: none;
    #frontpageslideshow .ISSClip {
        height: 361px;
        margin: 0 0px 0px 0px;
        border: solid 0px #ffffff;
        background-color: #ffffff;
    #frontpageslideshow .ISSControls {
        top: 0px;
        height: 361px;
    #frontpageslideshow .FilmStrip {
        height: 0px;
        background-color: #CCCCCC;
    #frontpageslideshow .FilmStripPreviousButton, #frontpageslideshow .FilmStripNextButton {
        width: 10px;
        height: 0px;
    #frontpageslideshow .FilmStripTrack {
        height: 0px;
    #frontpageslideshow .FilmStripContainer {
        height: 0px;
    #frontpageslideshow .FilmStripPanel {
        height: 0px;
        padding-left: 10px;
        margin-right: 0px;
    #frontpageslideshow .FilmStripPanel .ISSSlideLink {
        margin-top: 10px;
        border: solid 1px #AAAAAA;
        background-color: #FFFFFF;
    #frontpageslideshow .FilmStripPanel .ISSSlideLinkRight {
        border: solid 1px #AAAAAA;
        width: 56px;
        height: 47px;
        margin: 4px 4px 4px 4px;
    #frontpageslideshow .FilmStripCurrentPanel .ISSSlideLink {
        background-color: #ffffff;
        border-color: #000000;
    #frontpageslideshow .FilmStripCurrentPanel .ISSSlideLinkRight {
        border-color: #AAAAAA;
    /* EndOAWidget_Instance_2141543 */
    </style>
    <script type="text/xml">
    <!--
    <oa:widgets>
      <oa:widget wid="2141543" binding="#frontpageslideshow" />
    </oa:widgets>
    -->
    </script>
    </head>
    <body>
    <div class="container">
      <div class="header"><a href="index.html"><img src="images/logoimg.jpg" width="259" height="136" alt="logo" /></a><img src="images/topheader.jpg" width="701" height="136" alt="header_logo" /><!-- end .header --></div>
      <div class="content">
        <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="#">Weekly Ad</a>      </li>
          <li><a href="#">Recepies</a></li>
          <li><a href="#" class="MenuBarItemSubmenu">Entertaining</a>
            <ul>
              <li><a href="#">Bakery Brochure</a></li>
              <li><a href="#">Deli Platters</a></li>
              <li><a href="#">Catering Planner</a></li>
            </ul>
          </li>
          <li><a href="#">Pat's Best</a></li>
          <li><a href="#">Organics</a></li>
          <li><a href="#">Gift Cards</a>      </li>
          <li><a href="#" class="MenuBarItemSubmenu">Departments</a>
            <ul>
              <li><a href="#">Meats</a></li>
              <li><a href="#">Deli</a></li>
              <li><a href="#">Prepared Foods</a></li>
              <li><a href="#">Seafood</a></li>
              <li><a href="#">Produce</a></li>
              <li><a href="#">Bakery</a></li>
            </ul>
          </li>
        </ul>
        <p> </p>
        <ul id="frontpageslideshow" title="">
          <li><a href="images/fall.jpg" title=""><img src="http://labs.adobe.com/technologies/spry/ui/images/dbooth/thumbnails/photos-1.jpg" alt="fall.jpg" /></a></li>
          <li><a href="images/apples.jpg" title=""><img src="http://labs.adobe.com/technologies/spry/ui/images/dbooth/thumbnails/photos-10.jpg" alt="apples.jpg" /></a></li>
          <li><a href="images/applepie.jpg" title=""><img src="http://labs.adobe.com/technologies/spry/ui/images/dbooth/thumbnails/photos-11.jpg" alt="applepie.jpg" /></a></li>
          <li><a href="images/pumpkinsoup.jpg" title=""><img src="http://labs.adobe.com/technologies/spry/ui/images/dbooth/thumbnails/photos-12.jpg" alt="pumpkinsoup.jpg" /></a></li>
          <li><a href="images/roast.jpg" title="r"><img src="http://labs.adobe.com/technologies/spry/ui/images/dbooth/thumbnails/photos-13.jpg" alt="roast.jpg" /></a></li>
        </ul>
        <script type="text/javascript">
    // BeginOAWidget_Instance_2141543: #frontpageslideshow
    var frontpageslideshow = new Spry.Widget.ImageSlideShow("#frontpageslideshow", {
        widgetID: "frontpageslideshow",
        widgetClass: "BasicSlideShowFS",
        injectionType: "replace",
        autoPlay: true,
        displayInterval: 4500,
        transitionDuration: 2000,
        componentOrder: ["name", "title", "view", "controls", "links"],
        sliceMap: { BasicSlideShowFS: "3slice", ISSSlideLink: "3slice" },
        plugIns: [ Spry.Widget.ImageSlideShow.ThumbnailFilmStripPlugin ],
        TFSP: { pageIncrement: 4, wraparound: true }
    // EndOAWidget_Instance_2141543
        </script>
    Since this is a one-column layout, the .content is not floated.
        Logo Replacement
        An image placeholder was used in this layout in the .header where you'll likely want to place  a logo. It is recommended that you remove the placeholder and replace it with your own linked logo.
        Be aware that if you use the Property inspector to navigate to your logo image using the SRC field (instead of removing and replacing the placeholder), you should remove the inline background and display properties. These inline styles are only used to make the logo placeholder show up in browsers for demonstration purposes.    To remove the inline styles, make sure your CSS Styles panel is set to Current. Select the image, and in the Properties pane of the CSS Styles panel, right click and delete the display and background properties. (Of course, you can always go directly into the code and delete the inline styles from the image or placeholder there.) <!-- end .content --></div>
      <div class="footer">
        <p>About us  Other Services Employment Contacy us Terms of use Privacy Policy</p>
        <!-- end .footer --></div>
      <!-- end .container --></div>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>

    Your spry assets folder MUST be in the same folder as that of your webpage with the slideshow (html, php... whatever)
    Check your folder configuration on the server by clicking on the "Remote Button" on the DW Assets Tab.
    Example 1:  This will not work:
    WEBPAGE HERE:    /server/public/myfolder/slideshow.html
    SPRY ASSETS HERE:  /server/public/SpryAssets/....your javascript files
    Example 2: This will work:
    WEB PAGE HERE:  /server/public/myfolder/slideshow.html
    SPRY ASSETS HERE:  /server/public/myfolder/SpryAssets/....your javascript files
    Hope this helps.

  • Trouble with Keynote slide preview: blank white screen?

    I built an animated intro slide using several pictures and text boxes.  When I try to playback all i get is a blank white screen.  I can hit escape or the pause button and it returns me to Keynote without a problem. I just can preview my slide. New to Mac and Keynote, all help is

    By default, advancing the builds are set to manual,  so you need to press the space bar or click the left mouse button to play each build
    If you want the builds to advance automatically: in the animate inspector, click the build order button and change the start drop down menu to: after previous

  • Nokia 6500 slide, headset trouble

    i hav a nokia 6500s - 1 V 10.00
    i jus started using the headset. i plugged the headset..bt the phone did nt recognize it..( atleast, i dint show tht headset icon thingy )...i went to settings > enhancements  but onli found two options, tv cable and charger. so i plugged in the headset, and activated tv out...i cud use it to hear muzic, bt nuthin else, no radio......and the sound quality was horrible.
    after sumtime, the sound quality got better..n i chkd the screen, n thers the headset icon. i agn went to settings > enhancements n ther nw was a third option, headset!!!! i was surprised becoz im damn sure it wasnt ther b4..
    bt nw agn the phone doesnt recognize is n i hav to activate tv out to listen to muzic
    can nybdy plz help me solve this problem.
    n sorry for the loong post..i figured, if im explainin ma problem, i mite as well explain it in detail  

    Hello,
    I've recently got a new 6500 slide, it's an O2 model but I'm using it on Virgin (or T-Mobile as the phone tells me!)
    Anyway, it was fine for a couple of weeks and I'm very happy with it generally, until yesterday when mid call the other person could no longer hear me, and now the same on every call I make or receive. It seems as though the microphone has just simply given up, I've tried taking the sim and battery out for a few minutes - just on the off chance really but as I thought that didn't work!
    Also, and this isn't so much of a problem, just strange - whenever I take the cover off the back I lose my wallpaper!
    Anyone got any ideas.....??

  • Trouble publishing slide shows

    when i was using iphoto 6, my slide shows were published on this .mac page:
    http://homepage.mac.com/longhaulpro/PhotoAlbum1.html
    with iphoto '08 (version 7.1.2), the slide shows are published on another .mac site:
    http://gallery.mac.com/longhaulpro#100061
    the gallery.mac site that iphoto 7.1.2 is using moves very slowly and seems to have glitches (harder to move pictures and add captions after the slideshows are published)
    is there a way to go back to using the older .mac gallery i was using with iphoto 6, while still using iphoto 7.1.2 to load and organize my photos?
    thanks.
    dan collison

    dan:
    Your gallery opened and played very fast for me, without any hesitation. Maybe there were some server issues when you tried.
    You can still use the Homepage version by building the galleries/slideshows online. Go to the .Mac page, log in, and go to the Homepage section. There you will be able to create new segments.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries and Leopard. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

Maybe you are looking for