diff --git a/app/views/front/show_banner.html.erb b/app/views/front/show_banner.html.erb index 13ee2c694..0a59f1bda 100644 --- a/app/views/front/show_banner.html.erb +++ b/app/views/front/show_banner.html.erb @@ -3,7 +3,7 @@
<% (images = @ad_banner.ad_images).shuffle.each do |ad_image| %> <% if ad_image.display? %> - <%= ad_image.title || ' title='<%= ad_image.title || ' ' %>' time_to_next='<%= @ad_banner.transition_msec %>' link_open='<%= ad_image.link_open %>' link_url='<%= ad_image_link(ad_image) %>' style=' <%= 'cursor:pointer;' if !ad_image_link(ad_image).blank? %>'/> + <%= ad_image.title || ' title='<%= ad_image.title || ' ' %>' time_to_next='<%= @ad_banner.transition_msec %>' link_open='<%= ad_image.link_open %>' link_url='<%= ad_image_link(ad_image) %>' style=' <%= 'cursor:pointer;' if !ad_image_link(ad_image).blank? %>'/> <% end %> <% end %>
@@ -11,7 +11,9 @@ + \ No newline at end of file diff --git a/public/static/kernel.js b/public/static/kernel.js index 428c013f1..87de3e3d6 100644 --- a/public/static/kernel.js +++ b/public/static/kernel.js @@ -19,7 +19,12 @@ function ajax_load_proc(wapper,url,isBanner){ if (textSta == 'success') { if(isBanner=="true"){ wapper.html(respText); - BannerCycle(); + var banner = banners[banner_index]; + $(banner.banner_name+" > img").each(function(){ + $(this).load(function(){ banner.image_loaded++; }); + }); + BannerCycle(banner_index); + banner_index++; }else{ wapper.html(respText); } @@ -29,10 +34,9 @@ function ajax_load_proc(wapper,url,isBanner){ }); } -function BannerCycle(){ +function BannerCycle(banner_index){ var banner = banners[banner_index]; - banner_index++; - $.getScript('/static/jquery.cycle.all.latest.js', function(){ + if (!!$.prototype.cycle && (banner.image_loaded==$(banner.banner_name+" img").length)){ $(banner.banner_name).ready(function() { $(banner.banner_name).cycle({ delay: -1000, @@ -42,7 +46,10 @@ function BannerCycle(){ pagerAnchorBuilder: function(idx, slide) { return "
  • "; } }); }); - }); + }else{ + if(!$.prototype.cycle) $.getScript('/static/jquery.cycle.all.latest.js'); + setTimeout("BannerCycle("+banner_index+")",500); + } } // Ad Banner FX code [start] @@ -66,4 +73,4 @@ $(document).ready(function() { } }) }); -// Ad Banner FX code [end] +// Ad Banner FX code [end] \ No newline at end of file