From 6d5f1a2f126bf3ec97ff293a36a6558b5e3a2611 Mon Sep 17 00:00:00 2001 From: chris Date: Wed, 23 Oct 2013 15:50:08 +0800 Subject: [PATCH] Fix in js and css for pageslide and ad_banner --- app/assets/javascripts/admin/ad_banners.js | 2 +- .../lib/ad_banner/banner_preview.js | 5 ++--- app/assets/javascripts/lib/pageslide.js | 9 ++++---- app/assets/stylesheets/lib/pageslide.css | 22 ++++++++++++++++++- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/admin/ad_banners.js b/app/assets/javascripts/admin/ad_banners.js index 6ddfdd3a..d0592656 100644 --- a/app/assets/javascripts/admin/ad_banners.js +++ b/app/assets/javascripts/admin/ad_banners.js @@ -1,7 +1,7 @@ $(function() { $.pageslide.closeCallback(function(pageslide, item) { $("tr").removeClass("active"); - pageslide.find('.preview').cycle('destroy') + pageslide.find('.preview').cycle('destroy'); }); $.pageslide.loadComplete(function(pageslide, item) { $("tr").removeClass("active"); diff --git a/app/assets/javascripts/lib/ad_banner/banner_preview.js b/app/assets/javascripts/lib/ad_banner/banner_preview.js index 2376b53c..d740ebef 100644 --- a/app/assets/javascripts/lib/ad_banner/banner_preview.js +++ b/app/assets/javascripts/lib/ad_banner/banner_preview.js @@ -1,6 +1,6 @@ function slideshow (element, bannerEffect, bannerTime, bannerSpeed) { element.cycle('destroy'); - element.children('img').removeAttr('style'); + element.children('img').removeAttr('class');; element.cycle({ fx: bannerEffect, timeout: bannerTime, @@ -11,7 +11,6 @@ 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(); }); - element.cycle('destroy'); slideshow(element, data['fx'], 2000, 1000); } @@ -79,4 +78,4 @@ $(function() { slideshow($preview, $(this).val(), 2000, 1000); }); preview(); -}); \ No newline at end of file +}); diff --git a/app/assets/javascripts/lib/pageslide.js b/app/assets/javascripts/lib/pageslide.js index d8f09e52..ec502250 100644 --- a/app/assets/javascripts/lib/pageslide.js +++ b/app/assets/javascripts/lib/pageslide.js @@ -32,6 +32,7 @@ // Are we loading an element from the page or a URL? if ( settings.href.indexOf("#") === 0 ) { // Load a page element + window.console.log("in HTML"); var _contentHtml = $(settings.href).html(); var dtd = $.Deferred(); function appendHtml(dtd) { @@ -45,15 +46,14 @@ } $.when(appendHtml(dtd)) .done(function() { - setTimeout(function() { - $pageslide.find('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true }); - }, 1); + $pageslide.find('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true }); if(settings.loadComplete)settings.loadComplete.call(this, $pageslide, $element); }) .fail(function() {}); } else { // Load a URL. Into an iframe? if(settings.iframe) { + window.console.log("iFrame"); var iframe = $("