0

好的,我在页面上有一个调用这个的 js 脚本:

     function loadTheseimages(slideList) {

                jQuery(function($){

                    var slideIterate = [];
                    var slidesObj = new Object;

                    slideIterate = slideList.split(',');

                    $.each(slideIterate, function(key, value) { 

                            slidesObj += '{image: "' + value + '"}';  

                    });


                    $.supersized({

                        // Functionality
                        slide_interval          :   3000,       // Length between transitions
                        transition              :   1,          // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
                        transition_speed        :   700,        // Speed of transition

                        // Components                           
                        slide_links             :   'blank',    // Individual links for each slide (Options: false, 'num', 'name', 'blank')
                        slides                  :   [           // Slideshow Images
                                                            slidesObj  
                                                    ]

                    });                     
                });
            }

调用上述函数的脚本通过

    "http://cliffside.ca/wp-content/uploads/2012/06/cliff-side-nightsky.jpeg, http://cliffside.ca/wp-content/uploads/2012/05/Sunset.jpg, http://cliffside.ca/wp-content/uploads/2012/05/Relaxing-Room.jpg"

为什么它不起作用?

http://Cliffside.ca/

4

1 回答 1

0

澄清一下,必须传递给 supersized 的对象必须像这样构建:

    var slidesObj = new Array;
    $.each( data, function( key, value ) {
        var slide = new Object;         
        slide = {image:value };  
        slidesObj.push(slide);
    });

并且在调用超大时只需输入以下内容:

slides                  :   slidesObj,
于 2013-09-25T07:55:05.577 回答