JQuery - loop help

I want help using the cycle library for jQuery. I am a beginner and I got the absolute first one completed. This is the second on the page.

<script src="jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="jquery.cycle.all.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function() {

    $('.pics').cycle({
        fx:      'scrollDown',
        speed:    300,
        timeout:  2000
    });
</script>

      

My CSS is identical to what is on the page, so I put the .pics in quotes.

0


source to share


2 answers


I am guessing this just doesn't work for you.
You need to balance curly braces and parentheses. Please help others to help you by telling what the actual problem is next time.

Try the following:



$(document).ready(function() { 
    $('.pics').cycle({  
        fx: 'scrollDown',     
        speed: 300,     
        timeout: 2000 
    });
});

      

+2


source


Can you reopen this question? It works fine, but I'm having a very difficult time. I am trying to make the images float to the left and the text flows around it to the right like in the demo (no image content).

My script:

<script type="text/javascript">

$(document).ready(function() {
    $('.text')
    .before('<div id="slidenav">')
    .cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 6000,
        pager:  '#slidenav',
       pause: 1
    });
});

</script>

      

...

<div id="featured">
    <div class="text">
        <txp:article_custom form="slidetext" section="slide" limit="5" />
    </div>
</div>

      

and my CSS:



.text { width: 600px; height: 200px; border: 1px solid #ddd; background-color: green; }
.text div { width: 500px; height: 200px; padding: 15px; color: #333; text-align: left; font-size: 16px; background-color:red; }
.text div img {width: 200px; height: 200px; padding: 3px; background: orange }
.text div p{ background-color:black;}

      

Sorry no float properties here because none of them worked. I grabbed this CSS from the jQuery loop demo page.

And the result

http://img147.imageshack.us/img147/4434/jqueryhelpdl5.jpg http://img147.imageshack.us/img147/4434/jqueryhelpdl5.jpg

http://img147.imageshack.us/img147/4434/jqueryhelpdl5.jpg

0


source







All Articles