From a21c5c6d5c51b049fd49a4fb5203ad6f2fbc3766 Mon Sep 17 00:00:00 2001 From: Manson Wang Date: Wed, 2 Oct 2013 15:51:22 +0800 Subject: [PATCH] Ad_banner fixed --- app/views/front/show_banner.html.erb | 1 - public/static/kernel.js | 20 +++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/views/front/show_banner.html.erb b/app/views/front/show_banner.html.erb index ffbcb064a..13ee2c694 100644 --- a/app/views/front/show_banner.html.erb +++ b/app/views/front/show_banner.html.erb @@ -1,4 +1,3 @@ -<%= javascript_include_tag "lib/jquery.cycle.all.latest.js"%>
diff --git a/public/static/kernel.js b/public/static/kernel.js index ec2d5dc0b..428c013f1 100644 --- a/public/static/kernel.js +++ b/public/static/kernel.js @@ -19,7 +19,7 @@ function ajax_load_proc(wapper,url,isBanner){ if (textSta == 'success') { if(isBanner=="true"){ wapper.html(respText); - setTimeout("BannerCycle()", 2500); + BannerCycle(); }else{ wapper.html(respText); } @@ -32,15 +32,17 @@ function ajax_load_proc(wapper,url,isBanner){ function BannerCycle(){ var banner = banners[banner_index]; banner_index++; - $(banner.banner_name).ready(function() { - $(banner.banner_name).cycle({ - delay: -1000, - fx: banner.banner_fx, - timeoutFn: getTimeout, - pager: banner.banner_pager, - pagerAnchorBuilder: function(idx, slide) { return "
  • "; } + $.getScript('/static/jquery.cycle.all.latest.js', function(){ + $(banner.banner_name).ready(function() { + $(banner.banner_name).cycle({ + delay: -1000, + fx: banner.banner_fx, + timeoutFn: getTimeout, + pager: banner.banner_pager, + pagerAnchorBuilder: function(idx, slide) { return "
  • "; } + }); }); - }); + }); } // Ad Banner FX code [start]