From 405c2c5a12db5a87a938b3a3e4e02700c0daa930 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 11 Nov 2013 16:44:50 +0800 Subject: [PATCH] small fix for banner pagination. --- app/views/front/show_banner.html.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/front/show_banner.html.erb b/app/views/front/show_banner.html.erb index 11017d44..37cb4e9d 100644 --- a/app/views/front/show_banner.html.erb +++ b/app/views/front/show_banner.html.erb @@ -1,5 +1,5 @@
-
+
<% @ad_banner.ad_images.can_display.each do |ad_image| %> <% link = ad_image_link(ad_image) %> <%= image_tag ad_image.file, width: @ad_banner.width, height: @ad_banner.height, link_open: ad_image.link_open, link_url: link, style: "display:none; #{'cursor:pointer;' if link.present?}" %> @@ -17,6 +17,12 @@ <% end %> $.preload(a, 2, function(){ $('.orbit-cycle-slideshow').cycle(); + var lis = $("ul.banner_nav_<%= @ad_banner.title.dehumanize %> li"); + if( lis.length > a.length ){ + for( i = lis.length - 1; i > a.length - 1; i-- ){ + lis[i].remove(); + } + } }); } else{