我正在使用 CSS 样式display:block
并基于以下条件none
隐藏: If facebook has been blocked display else display 。div
fb_Blockedwizard
fb_wizard
当我加载或刷新页面时,div fb_Blockedwizard
它会显示几秒钟然后div
隐藏。
我需要div
在页面加载或刷新期间隐藏
下面是我正在使用的代码:
<script>
$(document).ready(function() {
hideFbBlockedwizard();
hidefbwizard();
var callbackOnSuccess = function(src) {
hideFbBlockedwizard();
showwizard();
return false;
};
var callbackOnFailure = function(src) {
hidefbwizard();
showFbBlockedwizard();
};
checkAvailability("http://www.facebook.com/favicon.ico",
callbackOnSuccess,callbackOnFailure);
});
function showFbBlockedwizard() {
document.getElementById('fb_Blockedwizard').style.display='block';
document.getElementById('fade').style.display='block';
}
function hideFbBlockedwizard() {
document.getElementById('fb_Blockedwizard').style.display='none';
document.getElementById('fade').style.display='none';
}
function checkAvailability(src, callbackSuccess, callbackFailure) {
$("<img/>").attr("src", src).load(function() {
callbackSuccess(src);
}).error(function() {
callbackFailure(src);
});
}
function showwizard() {
document.getElementById('fb_Blockedwizard').style.display='none';
document.getElementById('fb_wizard').style.display='block';
document.getElementById('fade').style.display='block';
}
这是我的CSS:
.white_content {
/*display: none;*/
display:none;
position: absolute;
top: 25%;
left: 25%;
width: 46%;
height: 37%;
padding: 16px;
border: 16px solid #999;
background-color: white;
z-index:1002;
overflow: auto;
}
.white_content1 {
display:none;
position: absolute;
top: 13%;
left: 18%;
width: 60%;
height: 63%;
padding: 16px;
border: 16px solid #999;
background-color: white;
z-index:1002;
overflow: auto;
}
这是我的PHP:
<div id="fb_wizard" class="white_content">
<?php include 'fb_blocked.php'; ?>
</div>
<div id="fb_Blockedwizard" class="white_content1">
<?php include 'fb_blocked_email.php'; ?> </div>