cycle js fix
piaoling 2013-04-12 13:44:00
function showCustomerGallery($galleryID){
$ngg_options = nggGallery::get_option(http://gccde.com/'ngg_optionshttp://gccde.com/');
//Set sort order value, if not used (upgrade issue)
$ngg_options[http://gccde.com/'galSorthttp://gccde.com/'] = ($ngg_options[http://gccde.com/'galSorthttp://gccde.com/']) ? $ngg_options[http://gccde.com/'galSorthttp://gccde.com/'] : http://gccde.com/'pidhttp://gccde.com/';
$ngg_options[http://gccde.com/'galSortDirhttp://gccde.com/'] = ($ngg_options[http://gccde.com/'galSortDirhttp://gccde.com/'] == http://gccde.com/'DESChttp://gccde.com/') ? http://gccde.com/'DESChttp://gccde.com/' : http://gccde.com/'ASChttp://gccde.com/';
$ngg_options[http://gccde.com/'irRotatetimehttp://gccde.com/'] = ($ngg_options[http://gccde.com/'irRotatetimehttp://gccde.com/'] == 0) ? 5 : $ngg_options[http://gccde.com/'irRotatetimehttp://gccde.com/'];
$width = (int) $ngg_options[http://gccde.com/'irWidthhttp://gccde.com/'];
$height = (int) $ngg_options[http://gccde.com/'irHeighthttp://gccde.com/'];
// get gallery values
//TODO: Use pagination limits here to reduce memory needs
$picturelist = nggdb::get_gallery($galleryID, $ngg_options[http://gccde.com/'galSorthttp://gccde.com/'], $ngg_options[http://gccde.com/'galSortDirhttp://gccde.com/']);
$out = "<div class=http://gccde.com/'gallerySlidehttp://gccde.com/' style=http://gccde.com/'width:" . $width . "px;http://gccde.com/'>";
$slides = "<div class=http://gccde.com/'slideshttp://gccde.com/' style=http://gccde.com/'width:" . $width . "px;height:".$height . "pxhttp://gccde.com/'>";
$nav = "<div class=http://gccde.com/'slides-navhttp://gccde.com/' style=http://gccde.com/'width:" . $width . "px;http://gccde.com/'>";
if(!empty($picturelist)) {
foreach($picturelist as $pic){
$slides .= "<div class=http://gccde.com/'slidehttp://gccde.com/'><img src=http://gccde.com/'" . $pic->imageURL . "http://gccde.com/' /></div>";
$nav .= "<div class=http://gccde.com/'slide-navhttp://gccde.com/'><img src=http://gccde.com/'" . $pic->thumbURL . "http://gccde.com/' /></div>";
}
}
$slides .= http://gccde.com/'</div>http://gccde.com/';
$nav .= http://gccde.com/'</div>http://gccde.com/';
$out .= $slides . $nav . "<div style=http://gccde.com/'clear:both;http://gccde.com/'></div></div>";
$script ="
<script>
jQuery(http://gccde.com/'documenthttp://gccde.com/').ready(function(){
var slides = jQuery(http://gccde.com/'.slideshttp://gccde.com/').cycle({
fx: http://gccde.com/'scrollRighthttp://gccde.com/',
speed: 1000,
pause: 1 ,
timeout: {$ngg_options[http://gccde.com/'irRotatetimehttp://gccde.com/']}*1000
});
var navs = jQuery(http://gccde.com/'.slides-nav imghttp://gccde.com/');
navs.click(gotoSlide);
function gotoSlide(){
var navs = jQuery(http://gccde.com/'.slides-nav imghttp://gccde.com/');
for(var i=0;i<navs.length;i++){
var next = i;
if(jQuery(navs[i]).attr(http://gccde.com/'srchttp://gccde.com/') == jQuery(this).attr(http://gccde.com/'srchttp://gccde.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;
$ngg_options = nggGallery::get_option(http://gccde.com/'ngg_optionshttp://gccde.com/');
//Set sort order value, if not used (upgrade issue)
$ngg_options[http://gccde.com/'galSorthttp://gccde.com/'] = ($ngg_options[http://gccde.com/'galSorthttp://gccde.com/']) ? $ngg_options[http://gccde.com/'galSorthttp://gccde.com/'] : http://gccde.com/'pidhttp://gccde.com/';
$ngg_options[http://gccde.com/'galSortDirhttp://gccde.com/'] = ($ngg_options[http://gccde.com/'galSortDirhttp://gccde.com/'] == http://gccde.com/'DESChttp://gccde.com/') ? http://gccde.com/'DESChttp://gccde.com/' : http://gccde.com/'ASChttp://gccde.com/';
$ngg_options[http://gccde.com/'irRotatetimehttp://gccde.com/'] = ($ngg_options[http://gccde.com/'irRotatetimehttp://gccde.com/'] == 0) ? 5 : $ngg_options[http://gccde.com/'irRotatetimehttp://gccde.com/'];
$width = (int) $ngg_options[http://gccde.com/'irWidthhttp://gccde.com/'];
$height = (int) $ngg_options[http://gccde.com/'irHeighthttp://gccde.com/'];
// get gallery values
//TODO: Use pagination limits here to reduce memory needs
$picturelist = nggdb::get_gallery($galleryID, $ngg_options[http://gccde.com/'galSorthttp://gccde.com/'], $ngg_options[http://gccde.com/'galSortDirhttp://gccde.com/']);
$out = "<div class=http://gccde.com/'gallerySlidehttp://gccde.com/' style=http://gccde.com/'width:" . $width . "px;http://gccde.com/'>";
$slides = "<div class=http://gccde.com/'slideshttp://gccde.com/' style=http://gccde.com/'width:" . $width . "px;height:".$height . "pxhttp://gccde.com/'>";
$nav = "<div class=http://gccde.com/'slides-navhttp://gccde.com/' style=http://gccde.com/'width:" . $width . "px;http://gccde.com/'>";
if(!empty($picturelist)) {
foreach($picturelist as $pic){
$slides .= "<div class=http://gccde.com/'slidehttp://gccde.com/'><img src=http://gccde.com/'" . $pic->imageURL . "http://gccde.com/' /></div>";
$nav .= "<div class=http://gccde.com/'slide-navhttp://gccde.com/'><img src=http://gccde.com/'" . $pic->thumbURL . "http://gccde.com/' /></div>";
}
}
$slides .= http://gccde.com/'</div>http://gccde.com/';
$nav .= http://gccde.com/'</div>http://gccde.com/';
$out .= $slides . $nav . "<div style=http://gccde.com/'clear:both;http://gccde.com/'></div></div>";
$script ="
<script>
jQuery(http://gccde.com/'documenthttp://gccde.com/').ready(function(){
var slides = jQuery(http://gccde.com/'.slideshttp://gccde.com/').cycle({
fx: http://gccde.com/'scrollRighthttp://gccde.com/',
speed: 1000,
pause: 1 ,
timeout: {$ngg_options[http://gccde.com/'irRotatetimehttp://gccde.com/']}*1000
});
var navs = jQuery(http://gccde.com/'.slides-nav imghttp://gccde.com/');
navs.click(gotoSlide);
function gotoSlide(){
var navs = jQuery(http://gccde.com/'.slides-nav imghttp://gccde.com/');
for(var i=0;i<navs.length;i++){
var next = i;
if(jQuery(navs[i]).attr(http://gccde.com/'srchttp://gccde.com/') == jQuery(this).attr(http://gccde.com/'srchttp://gccde.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;
}
发表评论(评论将通过邮件发给作者):