Ad_banner fixed

This commit is contained in:
Manson Wang 2013-10-02 15:51:22 +08:00
parent b180ef41f7
commit a21c5c6d5c
2 changed files with 11 additions and 10 deletions

View File

@ -1,4 +1,3 @@
<%= javascript_include_tag "lib/jquery.cycle.all.latest.js"%>
<div style='position:relative'> <div style='position:relative'>
<ul id='banner_nav' class='clear banner_nav-<%= @ad_banner.title.dehumanize %>'></ul> <ul id='banner_nav' class='clear banner_nav-<%= @ad_banner.title.dehumanize %>'></ul>
<div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'> <div id='slideshow-<%= @ad_banner.title.dehumanize %>' class='slideshow'>

View File

@ -19,7 +19,7 @@ function ajax_load_proc(wapper,url,isBanner){
if (textSta == 'success') { if (textSta == 'success') {
if(isBanner=="true"){ if(isBanner=="true"){
wapper.html(respText); wapper.html(respText);
setTimeout("BannerCycle()", 2500); BannerCycle();
}else{ }else{
wapper.html(respText); wapper.html(respText);
} }
@ -32,15 +32,17 @@ function ajax_load_proc(wapper,url,isBanner){
function BannerCycle(){ function BannerCycle(){
var banner = banners[banner_index]; var banner = banners[banner_index];
banner_index++; banner_index++;
$(banner.banner_name).ready(function() { $.getScript('/static/jquery.cycle.all.latest.js', function(){
$(banner.banner_name).cycle({ $(banner.banner_name).ready(function() {
delay: -1000, $(banner.banner_name).cycle({
fx: banner.banner_fx, delay: -1000,
timeoutFn: getTimeout, fx: banner.banner_fx,
pager: banner.banner_pager, timeoutFn: getTimeout,
pagerAnchorBuilder: function(idx, slide) { return "<li><a href='#'></a></li>"; } pager: banner.banner_pager,
pagerAnchorBuilder: function(idx, slide) { return "<li><a href='#'></a></li>"; }
});
}); });
}); });
} }
// Ad Banner FX code [start] // Ad Banner FX code [start]