cycle js fix

piaoling  2013-04-12 13:44:00
function showCustomerGallery($galleryID){
    $ngg_options = nggGallery::get_option(http://doingthing.com/'ngg_optionshttp://doingthing.com/');
    
    //Set sort order value, if not used (upgrade issue)
    $ngg_options[http://doingthing.com/'galSorthttp://doingthing.com/'] = ($ngg_options[http://doingthing.com/'galSorthttp://doingthing.com/']) ? $ngg_options[http://doingthing.com/'galSorthttp://doingthing.com/'] : http://doingthing.com/'pidhttp://doingthing.com/';
    $ngg_options[http://doingthing.com/'galSortDirhttp://doingthing.com/'] = ($ngg_options[http://doingthing.com/'galSortDirhttp://doingthing.com/'] == http://doingthing.com/'DESChttp://doingthing.com/') ? http://doingthing.com/'DESChttp://doingthing.com/' : http://doingthing.com/'ASChttp://doingthing.com/';
    $ngg_options[http://doingthing.com/'irRotatetimehttp://doingthing.com/'] = ($ngg_options[http://doingthing.com/'irRotatetimehttp://doingthing.com/'] == 0) ? 5 : $ngg_options[http://doingthing.com/'irRotatetimehttp://doingthing.com/'];
    $width  = (int) $ngg_options[http://doingthing.com/'irWidthhttp://doingthing.com/'];
    $height = (int) $ngg_options[http://doingthing.com/'irHeighthttp://doingthing.com/'];
    
    // get gallery values
    //TODO: Use pagination limits here to reduce memory needs
    $picturelist = nggdb::get_gallery($galleryID, $ngg_options[http://doingthing.com/'galSorthttp://doingthing.com/'], $ngg_options[http://doingthing.com/'galSortDirhttp://doingthing.com/']);
    $out = "<div class=http://doingthing.com/'gallerySlidehttp://doingthing.com/' style=http://doingthing.com/'width:" . $width . "px;http://doingthing.com/'>";
    $slides = "<div class=http://doingthing.com/'slideshttp://doingthing.com/' style=http://doingthing.com/'width:" . $width . "px;height:".$height . "pxhttp://doingthing.com/'>";
    $nav = "<div class=http://doingthing.com/'slides-navhttp://doingthing.com/' style=http://doingthing.com/'width:" . $width . "px;http://doingthing.com/'>";
    if(!empty($picturelist)) {
        foreach($picturelist as $pic){
            $slides .= "<div class=http://doingthing.com/'slidehttp://doingthing.com/'><img src=http://doingthing.com/'" . $pic->imageURL . "http://doingthing.com/' /></div>";
            $nav .= "<div class=http://doingthing.com/'slide-navhttp://doingthing.com/'><img src=http://doingthing.com/'" . $pic->thumbURL . "http://doingthing.com/' /></div>";
        }
    }
    $slides .= http://doingthing.com/'</div>http://doingthing.com/';
    $nav .= http://doingthing.com/'</div>http://doingthing.com/';
    $out .= $slides . $nav . "<div style=http://doingthing.com/'clear:both;http://doingthing.com/'></div></div>";
    $script ="
    <script>
    jQuery(http://doingthing.com/'documenthttp://doingthing.com/').ready(function(){
        var slides = jQuery(http://doingthing.com/'.slideshttp://doingthing.com/').cycle({
            fx:      http://doingthing.com/'scrollRighthttp://doingthing.com/',
            speed:    1000,
            pause:   1 ,
            timeout:  {$ngg_options[http://doingthing.com/'irRotatetimehttp://doingthing.com/']}*1000
            
        });
        
        var navs = jQuery(http://doingthing.com/'.slides-nav imghttp://doingthing.com/');
        navs.click(gotoSlide);
        function gotoSlide(){
            
            var navs = jQuery(http://doingthing.com/'.slides-nav imghttp://doingthing.com/');
            for(var i=0;i<navs.length;i++){
                var next = i;
                if(jQuery(navs[i]).attr(http://doingthing.com/'srchttp://doingthing.com/') == jQuery(this).attr(http://doingthing.com/'srchttp://doingthing.com/')){
                    
                    if(next>navs.length){
                        next = 1 ;
                    }
                    fwd=0;
                    if(slides.cycle.options.currSlide < next){
                        fwd =1;
                    }
                    var p = slides.cycle.options.$cont[0], timeout = p.cycleTimeout;
                    if (timeout) {
                        clearTimeout(timeout);
                        p.cycleTimeout = 0;
                    }
                    slides.cycle.options.nextSlide= next;
                    
                    slides.cycle.go(slides.cycle.options.elements,slides.cycle.options,1,fwd);
                    break;
                }
            }
        }
    })
    </script>
";
    return $out .$script;

}


dowload:cycle js fix

类别 :  默认(751)  |  浏览(4394)  |  评论(0)
发表评论(评论将通过邮件发给作者):

Email: