超大滑块+ Wp电子商务

时间:2012-03-05 21:28:24

标签: supersized

我已经使用Supersized滑块与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; ?>    
                                            ]

            }); 
        });

1 个答案:

答案 0 :(得分:1)

您是否尝试过此插件安装WP Supersized

你也可以按照这些教程链接,我希望这是你需要的,让我知道。

How to integrate Supersized in wordpress

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

如果您已经解决了这个问题 - 请您为自己的利益发布您的答案