2014-07-08 01:46:25 +00:00
|
|
|
<div>
|
|
|
|
<div
|
|
|
|
id='slideshow-<%= @ad_banner.title.dehumanize %>'
|
|
|
|
class="orbit-cycle-slideshow"
|
|
|
|
data-cycle-timeout="<%= @ad_banner.timeout_millisecond %>"
|
|
|
|
data-cycle-fx="<%= @ad_banner.ad_fx %>"
|
|
|
|
|
|
|
|
data-cycle-pager-active-class="activeSlide"
|
|
|
|
data-cycle-random='true'
|
|
|
|
|
|
|
|
data-cycle-slides=".slide-img"
|
|
|
|
data-overlay=".adBanner-overlay .caption"
|
|
|
|
data-pager=".<%= @ad_banner.title.dehumanize %> .navigation"
|
|
|
|
data-cycle-pager-template="<li class='dot'></li>"
|
|
|
|
style="z-index: 0">
|
|
|
|
|
2014-01-16 10:15:00 +00:00
|
|
|
<% @ad_banner.ad_images.can_display.each do |ad_image| %>
|
2014-07-08 01:46:25 +00:00
|
|
|
<div
|
|
|
|
class="slide-img"
|
|
|
|
data-cycle-title="<%= ad_image.title %>"
|
|
|
|
data-cycle-desc="<%= ad_image.context %>"
|
|
|
|
data-overlay-template="<h2><%= ad_image.title %></h2><%= ad_image.context %>">
|
|
|
|
<% link = ad_image_link(ad_image) %>
|
|
|
|
<%= image_tag ad_image.file, alt: ad_image.title, title: ad_image.title, width: @ad_banner.width, height: @ad_banner.height, link_open: ad_image.link_open, link_url: link, style: "#{'cursor:pointer;' if link.present?}" %>
|
|
|
|
<%= %>
|
|
|
|
</div>
|
2014-01-16 10:15:00 +00:00
|
|
|
<% end %>
|
|
|
|
</div>
|
2014-07-08 01:46:25 +00:00
|
|
|
<div class="<%= @ad_banner.title.dehumanize %> adBanner-overlay">
|
|
|
|
<div class="caption"></div>
|
|
|
|
<ul class="navigation"></ul>
|
|
|
|
</div>
|
|
|
|
<!-- <ul class='clear banner_nav banner_nav_<%#= @ad_banner.title.dehumanize %>'></ul> -->
|
2014-01-16 10:15:00 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$(function(){
|
2014-07-08 01:46:25 +00:00
|
|
|
// if($("#slideshow-<%= @ad_banner.title.dehumanize %> img").length > 1){
|
|
|
|
// var a = [];
|
|
|
|
// <% @ad_banner.ad_images.can_display.each do |image| %>
|
|
|
|
// a.push("<%= image.file.url %>");
|
|
|
|
// <% 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{
|
|
|
|
// $("#slideshow-<%= @ad_banner.title.dehumanize %> img").show()
|
|
|
|
// }
|
|
|
|
$('.orbit-cycle-slideshow').cycle();
|
2014-01-16 10:15:00 +00:00
|
|
|
});
|
|
|
|
</script>
|