Fix in js and css for pageslide and ad_banner

This commit is contained in:
chris 2013-10-23 15:50:08 +08:00
parent 94c1d7d5a0
commit 6d5f1a2f12
4 changed files with 29 additions and 9 deletions

View File

@ -1,7 +1,7 @@
$(function() { $(function() {
$.pageslide.closeCallback(function(pageslide, item) { $.pageslide.closeCallback(function(pageslide, item) {
$("tr").removeClass("active"); $("tr").removeClass("active");
pageslide.find('.preview').cycle('destroy') pageslide.find('.preview').cycle('destroy');
}); });
$.pageslide.loadComplete(function(pageslide, item) { $.pageslide.loadComplete(function(pageslide, item) {
$("tr").removeClass("active"); $("tr").removeClass("active");

View File

@ -1,6 +1,6 @@
function slideshow (element, bannerEffect, bannerTime, bannerSpeed) { function slideshow (element, bannerEffect, bannerTime, bannerSpeed) {
element.cycle('destroy'); element.cycle('destroy');
element.children('img').removeAttr('style'); element.children('img').removeAttr('class');;
element.cycle({ element.cycle({
fx: bannerEffect, fx: bannerEffect,
timeout: bannerTime, timeout: bannerTime,
@ -11,7 +11,6 @@ function setSlideshow(element, data) {
$("#pageslide .ad_banner_ad_fx").children('option:selected').each(function(index, el) { $("#pageslide .ad_banner_ad_fx").children('option:selected').each(function(index, el) {
$(this).val() == 'flipHorz' || $(this).val() == 'flipVert' ? $('.suckIE').show() : $('.suckIE').hide(); $(this).val() == 'flipHorz' || $(this).val() == 'flipVert' ? $('.suckIE').show() : $('.suckIE').hide();
}); });
element.cycle('destroy');
slideshow(element, data['fx'], 2000, 1000); slideshow(element, data['fx'], 2000, 1000);
} }

View File

@ -32,6 +32,7 @@
// Are we loading an element from the page or a URL? // Are we loading an element from the page or a URL?
if ( settings.href.indexOf("#") === 0 ) { if ( settings.href.indexOf("#") === 0 ) {
// Load a page element // Load a page element
window.console.log("in HTML");
var _contentHtml = $(settings.href).html(); var _contentHtml = $(settings.href).html();
var dtd = $.Deferred(); var dtd = $.Deferred();
function appendHtml(dtd) { function appendHtml(dtd) {
@ -45,15 +46,14 @@
} }
$.when(appendHtml(dtd)) $.when(appendHtml(dtd))
.done(function() { .done(function() {
setTimeout(function() {
$pageslide.find('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true }); $pageslide.find('.nano').nanoScroller({ scrollTop: 0, iOSNativeScrolling: true });
}, 1);
if(settings.loadComplete)settings.loadComplete.call(this, $pageslide, $element); if(settings.loadComplete)settings.loadComplete.call(this, $pageslide, $element);
}) })
.fail(function() {}); .fail(function() {});
} else { } else {
// Load a URL. Into an iframe? // Load a URL. Into an iframe?
if(settings.iframe) { if(settings.iframe) {
window.console.log("iFrame");
var iframe = $("<iframe />").attr({ var iframe = $("<iframe />").attr({
src: settings.href, src: settings.href,
frameborder: 0, frameborder: 0,
@ -66,6 +66,7 @@
$pageslide.find('.content').html(iframe).show(); $pageslide.find('.content').html(iframe).show();
if(settings.loadComplete)settings.loadComplete.call(this, $pageslide, $element); if(settings.loadComplete)settings.loadComplete.call(this, $pageslide, $element);
} else { } else {
window.console.log("Load");
$pageslide.find('.content').load(settings.href, function(response, status, xhr){ $pageslide.find('.content').load(settings.href, function(response, status, xhr){
if(status == 'success') { if(status == 'success') {
$pageslide.show(); $pageslide.show();
@ -77,9 +78,9 @@
} }
}); });
} }
if($pageslide.find('.error-cover').length) $pageslide.find('.error-cover').remove();
$pageslide.data( 'localEl', false ); $pageslide.data( 'localEl', false );
} }
if($pageslide.find('.error-cover').length) $pageslide.find('.error-cover').remove();
_checkTitle(settings); _checkTitle(settings);
} }

View File

@ -70,7 +70,7 @@
} }
#pageslide .preview { #pageslide .preview {
position: relative; position: relative;
height: 80px; /*height: 80px;*/
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
@ -116,3 +116,23 @@
#pageslide .suckIE { #pageslide .suckIE {
color: #EE4545; color: #EE4545;
} }
#pageslide .link-options {
display: none;
}
#pageslide .active-link {
margin-bottom: 10px;
}
#pageslide .active-link > label {
margin-bottom: 0;
}
#pageslide .active-link .active-mune {
margin-left: 20px;
display: none;
}
#pageslide .active-link .active-mune span {
display: inline-block;
margin-right: 20px;
margin-top: 5px;
color: #8A8A8A;
float: left;
}