我使用sohtanaka.com中的'簡單內聯模式窗口css'腳本。由於這個網站離線,我現在找不到我的答案。更改簡單的內聯模式窗口css腳本
有人可以幫我嗎?
我想只顯示一次彈出窗口,當頁面被加載,沒有它不斷顯示。
股利,其中包含彈出:
<div id="popup_load" class="popup_block">
<b>Lorem ipsum dolores sit amet</b>
</div>
腳本
<script type="text/javascript">
$(document).ready(function(){
$.fn.popOpen = function(){
var popID = $(this).attr('rel'); //Get Popup Name
var popURL = $(this).attr('href'); //Get Popup href to define size
//Pull Query & Variables from href URL
var query= popURL.split('?');
var dim= query[1].split('&');
var popWidth = dim[0].split('=')[1]; //Gets the first query string value
//Fade in the Popup and add close button
$('#' + popID).fadeIn('slow').css({ 'width': Number(popWidth) }).prepend('<a href="#" class="close"><img src="images/close.png" class="btn_close" title="<?php echo $lang['sluit'] ?>" /></a>');
//Define margin for center alignment (vertical horizontal) - we add 80px to the height/width to accomodate for the padding and border width defined in the css
var popMargTop = ($('#' + popID).height() + 20)/2;
var popMargLeft = ($('#' + popID).width() + 20)/2;
//Apply Margin to Popup
$('#' + popID).css({
'margin-top' : -popMargTop,
'margin-left' : -popMargLeft
});
//Fade in Background
$('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
$('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer - .css({'filter' : 'alpha(opacity=80)'}) is used to fix the IE Bug on fading transparencies
};
$('a.poplight[href=#?w=400]').popOpen(); //Run popOpen function once on load
//Close Popups and Fade Layer
//$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
$('a.close').live('click', function() { //When clicking on the close...
$('#fade , .popup_block').fadeOut(function() {
$('#fade, a.close').remove(); //fade them both out
location.reload(); // reload page
});
return false;
});
popOpen
});
</script>
那是一個錯字? pop打開標籤前的最後一行 – Vikram 2012-08-03 19:38:13