我和我一起工作
$(function(){
$("#awesome-link").colorbox({
onOpen: function(){
$("#colorbox").css("opacity", 0);
},
onComplete: function(){
$("#colorbox").css("opacity", 1);
}
});
});
color-box
但是当我使用颜色框的transition:"fade"
属性时,它会变成黑色淡入淡出然后打开。
现在我改变我的代码jquery.colorbox.js
colorbox js
注释或删除文件中的以下代码
/*var initialWidth = setSize(settings.get('initialWidth'), 'x');
var initialHeight = setSize(settings.get('initialHeight'), 'y');
var maxWidth = settings.get('maxWidth');
var maxHeight = settings.get('maxHeight');
settings.w = (maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, 'x')) : initialWidth) - loadedWidth - interfaceWidth;
settings.h = (maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, 'y')) : initialHeight) - loadedHeight - interfaceHeight;
$loaded.css({width:'', height:settings.h});
*/
/*$loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div,"LoadingGraphic")[0]]); */
$slideshow = $tag('button', "Slideshow")/*,
$loadingOverlay*/
/* clearTimeout(loadingTimer);
$loadingOverlay.hide();*/
/* loadingTimer = setTimeout(function () {
$loadingOverlay.show();
}, 100);*/
并更改以下代码
overlay.css({
opacity: opacity === opacity ? opacity : '',
cursor: settings.get('overlayClose') ? 'pointer' : '',
visibility: 'visible'
}).show(500);
到,
setTimeout(function(){
$overlay.css({
opacity: opacity === opacity ? opacity : '',
cursor: settings.get('overlayClose') ? 'pointer' : '',
visibility: 'visible'
}).fadeIn(500);
}, 600);
现在它工作顺利。