www.webdeveloper.com
Results 1 to 3 of 3

Thread: addClass cant turn on the plugin

  1. #1
    Join Date
    Jan 2013
    Posts
    2

    addClass cant turn on the plugin

    im working on some project, and i'm trying to turn on the gallery slideshow after "x" msec,
    but when i'm adding the class, the cycle plugin just not working, the code:

    jQuery:
    HTML Code:
        $('.gallery-slideshow').cycle({
            fx:     'fade',
            speed:  'fast',
            timeout: 1000,  
            random: 1
        });
            
    
    
      setInterval (function (){        $('#girl').addClass('gallery-slideshow');    }, 600);
    i also tried to add an attribute of class:

    HTML Code:
        $('.gallery-slideshow').cycle({        fx:     'fade',        speed:  'fast',        timeout: 1000,          random: 1    });
    
        setInterval (function (){            $('#girl').attr('class', 'gallery-slideshow');    }, 600);
    but its not working.

    html:
    HTML Code:
                   <div class="gallery">            <div id="girl">                    <img src="../Images/gallery-imgs/1.jpg" alt="" />                <img src="../Images/gallery-imgs/2.jpg" alt="" />                <img src="../Images/gallery-imgs/3.jpg" alt="" />                <img src="../Images/gallery-imgs/4.jpg" alt="" />            </div>        </div>
    i appreciate your help, thanks

  2. #2
    Join Date
    Jan 2013
    Posts
    2
    sorry for the double, but i really need help.

  3. #3
    Join Date
    Aug 2008
    Location
    Sweden
    Posts
    227
    You must execute the .cycle function after you've added the gallery-slideshow class to the #girl element.

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