1

我已经调整了超大滑块以与 WP 电子商务一起创建特色产品滑块。

它非常适用于在我安装滑块之前归因于特色类别的产品,但是一旦我将新产品添加到该类别中,它就会中断。

有人可以快速查看我的代码,看看我是否可以做得更好,并找出它出错的原因吗?在我看来,这在逻辑上是不可能的!

可以在这里查看我的来源:http: //thetechhunter.co.za/

var $j = jQuery.noConflict(); 

        jQuery(function($){
            $j.supersized({

                //Functionality
                slideshow               :   1,      //Slideshow on/off
                autoplay                :   1,      //Slideshow starts playing automatically
                start_slide             :   1,      //Start slide (0 is random)
                random                  :   0,      //Randomize slide order (Ignores start slide)
                slide_interval          :   10000,  //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        :   500,    //Speed of transition
                new_window              :   0,      //Image links open in new window/tab
                pause_hover             :   0,      //Pause slideshow on hover
                keyboard_nav            :   1,      //Keyboard navigation on/off
                performance             :   1,      //0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
                image_protect           :   1,      //Disables image dragging and right click with Javascript
                image_path              :   'img/', //Default image path

                //Size & Position
                min_width               :   0,      //Min width allowed (in pixels)
                min_height              :   0,      //Min height allowed (in pixels)
                vertical_center         :   1,      //Vertically center background
                horizontal_center       :   1,      //Horizontally center background
                fit_portrait            :   1,      //Portrait images will not exceed browser height
                fit_landscape           :   0,      //Landscape images will not exceed browser width

                //Components
                navigation              :   1,      //Slideshow controls on/off
                thumbnail_navigation    :   1,      //Thumbnail navigation
                slide_counter           :   1,      //Display slide numbers
                slide_captions          :   1,      //Slide caption (Pull from "title" in slides array)
                slides                  :   [       //Slideshow Images


                                    <?php $my_query = new WP_Query( array( 'post_type' => 'wpsc-product', 'wpsc_product_category'=>'featured-products' ) ); while( $my_query->have_posts() ) : $my_query->the_post();?>

                                                    {image : '<?php echo wpsc_the_product_image(); ?>', 
                                                     title : '<div class="slidecaptioninside"><a href="<?php echo wpsc_the_product_permalink(); ?>"><?php echo wpsc_the_product_title(); ?></a><br /><span style="color: #111;"><?php echo wpsc_the_product_price(); ?></span></div><br /><div class="slidedescription"><?php $excerpt = wpsc_the_product_description(); echo string_limit_words($excerpt,50)."...";?></div>', 
                                                      url : '<?php echo wpsc_the_product_permalink(); ?>'},  

                                    <?php endwhile; ?>    
                                            ]

            }); 
        });
4

1 回答 1

1

你试过这个插件安装WP Supersized

您也可以点击这些教程链接,我希望这是您需要的并让我知道。

如何在 wordpress 中集成 Supersized

在插件中,作者似乎正在使用“function slides_list()”来输出图像数组并删除最后一张幻灯片的逗号。

如果您已经解决了这个问题 - 您能否为了他人的利益发布您的答案

于 2012-05-28T02:59:55.373 回答