xrcwrn
xrcwrn

Reputation: 5325

slideshow images using jQuery Cycle Plugin

I am trying to slideshow images using jQuery Cycle Plugin, but it is not working. How to make it runnable.

Included scripts

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script src="https://malsup.github.com/jquery.cycle.all.js"></script>    

CSS:

 .pics {  
            height:  232px;  
            width:   232px;  
            padding: 0;  
            margin:  0;  
        } 

        .pics img {  
            padding: 15px;  
            border:  1px solid #ccc;  
            background-color: #eee;  
            width:  200px; 
            height: 200px; 
            top:  0; 
            left: 0 
        }

Script:

  $(function(){
        $('.pics').cycle('fade');
    });​

Pic Div

          <div class="pics">
                <img src="http://davealger.info/i/1.jpg"  width="200" height="200"  />
                <img src="http://davealger.info/i/2.bmp"  width="200" height="200"  />
                <img src="http://davealger.info/i/3.png"  width="200" height="200" />
            </div>

Upvotes: 2

Views: 17804

Answers (3)

bobthyasian
bobthyasian

Reputation: 943

If you are set on not downloading the script to locally, then keep up-to-date.

  1. Cycle.js was moved.
  2. Don't use http:// or https://

Here, this was taken from the website's demo and edited a tad:

<!-- include jQuery library -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<!-- include Cycle plugin -->
<script type="text/javascript" src="//cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $('.slideshow').cycle({
        fx: 'fade' 
    });
});
</script>

Notice that the location of the cycle.js
It pays to look at demos' source codes.

Upvotes: 1

Blazemonger
Blazemonger

Reputation: 92893

Change https://malsup.github.com/jquery.cycle.all.js to http:// -- or better yet, download the plugin and spare his poor server. Google uses a high-volume CDN; he does not.

http://jsfiddle.net/mblase75/ZSJqh/

Upvotes: 2

long
long

Reputation: 4310

$(function(){
    $('.pics').cycle({fx: 'fade'});
});​

See docs: http://malsup.com/jquery/cycle/

Upvotes: 0

Related Questions