> Hi, I can't get jQuery cycle to work and I have no idea why, so I
> would really appreciate some help.
>
> my code:
>
> HTML
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//SV"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="sv" dir="ltr"
> lang="sv">
> <html>
> <head>
>         <title>CYCLE</title>
>         <style type="text/css" media="all">
>         @import url(css/cycle.css);</style>
>         <script type="text/javascript" src="jquery-1.2.6.js"></script>
>         <script type="text/javascript" src="jquery.cycle.all.pack"></script>
>
>         <script type="text/javascript">
>                         $(document).ready(function(){
>                                 $('#s1').cycle({
>                                         fx: 'scrollDown'
>                                 });
>                         });
>         </script>
>
> </head>
> <body>
> <div id="wrapper">
>         <div id="s1" class="cycle">
>                 <img src="images/1.jpg"/>
>                 <img src="images/2.jpg"/>
>                 <img src="images/3.jpg"/>
>                 <img src="images/4.jpg"/>
>         </div>
> </div>
> </body>
> </html>
>
> CSS
>
> #cycle {
>         height:  253px;
>         width:   503px;
>         padding: 0;
>         margin:  0;
>
> }
>
> #cycle img {
>     padding: 15px;
>     border:  1px solid #ccc;
>     background-color: #eee;
>     width:  500px;
>     height: 250px;
>     top:  0;
>     left: 0
>
> }
>
> As you can see, it's extremely basic, since I'm just testing the
> plugin. But why why can't I get it to work..
> Also I get this error message in firebug:
>
> $("#s1").cycle is not a function
> (no name)()cycle.html (line 16)
> to the wait list jQuery.readyList.push()jquery-1.2.6.js (line 2294)
> (no name)()jquery-1.2.6.js (line 2314)
> each([function()], function(), undefined)jquery-1.2.6.js (line 745)
> ready()jquery-1.2.6.js (line 2313)
> [Break on this error] fx: 'scrollDown'
>
> Thanks in advance for any help.


Looks like you're missing the file extension for the Cycle plugin in
your script tag:

<script type="text/javascript" src="jquery.cycle.all.pack"></script>

Also, your css rules don't make sense because your document does not
have any element with the ID of "cycle".  I think you meant to make
rules for either #s1 or .cycle.

Mike

Reply via email to