effects working and also the widht and height

This commit is contained in:
Harry Bomrah 2015-10-12 15:22:51 +08:00
parent 6a2525bd65
commit f58512ec35
4 changed files with 5 additions and 9 deletions

View File

@ -8,9 +8,6 @@ function slideshow (element, bannerEffect, bannerTime, bannerSpeed) {
}); });
}; };
function setSlideshow(element, data) { function setSlideshow(element, data) {
$("#pageslide .ad_banner_ad_fx").children('option:selected').each(function(index, el) {
$(this).val() == 'flipHorz' || $(this).val() == 'flipVert' ? $('.suckIE').show() : $('.suckIE').hide();
});
slideshow(element, data['fx'], 2000, 1000); slideshow(element, data['fx'], 2000, 1000);
} }
@ -72,9 +69,6 @@ $(function() {
bannerTime = parseInt(bannerTime) || 300; bannerTime = parseInt(bannerTime) || 300;
bannerSpeed = parseInt(bannerSpeed) || 300; bannerSpeed = parseInt(bannerSpeed) || 300;
$(this).children('option:selected').each(function(index, el) {
$(this).val() == 'flipHorz' || $(this).val() == 'flipVert' ? $('.suckIE').show() : $('.suckIE').hide();
});
slideshow($preview, $(this).val(), 2000, 1000); slideshow($preview, $(this).val(), 2000, 1000);
}); });
preview(); preview();

View File

@ -32,6 +32,8 @@ class AdBannersController < ApplicationController
"ad_fx" => adbanner.ad_fx, "ad_fx" => adbanner.ad_fx,
"speed" => adbanner.speed, "speed" => adbanner.speed,
"title" => adbanner.title, "title" => adbanner.title,
"height" => adbanner.height,
"width" => adbanner.width,
"timeout" => (adbanner.timeout * 1000), "timeout" => (adbanner.timeout * 1000),
"more" => "More" "more" => "More"
}, },

View File

@ -17,7 +17,7 @@ class Banner
validates :title, :length => { :minimum => 2 } validates :title, :length => { :minimum => 2 }
validates :height, :speed, :timeout, :width, :presence => true validates :height, :speed, :timeout, :width, :presence => true
FX_TYPES = %w(fade fadeout flipHorz flipVert scrollHorz scrollVert tileSlide tileBlind) FX_TYPES = %w(fade scrollHorz scrollVert tileSlide tileBlind)
def size def size
"#{self.width} x #{self.height}" "#{self.width} x #{self.height}"

View File

@ -15,9 +15,9 @@
<%= f.label :size, t('ad_banner.size') %> <%= f.label :size, t('ad_banner.size') %>
<span class="banner_set">W</span> <span class="banner_set">W</span>
<%= f.number_field :width, in: 10..1000, step: 10, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;", id: 'width' %> <%= f.number_field :width, in: 10..3000, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;", id: 'width' %>
<span class="banner_set">H</span> <span class="banner_set">H</span>
<%= f.number_field :height, in: 10..1000, step: 10, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;", id: 'height' %> <%= f.number_field :height, in: 10..3000, class: 'input-mini', onkeypress: "if (event.keyCode < 48 || event.keyCode > 57) event.returnValue = false;", id: 'height' %>
<%= f.label :category_id, t('ad_banner.categories') %> <%= f.label :category_id, t('ad_banner.categories') %>
<%= f.select :category_id, @categories, {} %> <%= f.select :category_id, @categories, {} %>