Jquery 更改简单内联模式窗口css脚本
我正在使用sohtanaka.com上的“简单内联模式窗口css”脚本。因为这个网站是离线的,我现在找不到我的答案 有人能帮我吗 我只想在页面加载时显示一次弹出窗口,不,它会一直显示 包含弹出窗口的Div:Jquery 更改简单内联模式窗口css脚本,jquery,css,Jquery,Css,我正在使用sohtanaka.com上的“简单内联模式窗口css”脚本。因为这个网站是离线的,我现在找不到我的答案 有人能帮我吗 我只想在页面加载时显示一次弹出窗口,不,它会一直显示 包含弹出窗口的Div: <div id="popup_load" class="popup_block"> <b>Lorem ipsum dolores sit amet</b> </div> 洛雷姆·伊普苏姆·多洛雷斯·西特 剧本 <script typ
<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>
$(文档).ready(函数(){
$.fn.popOpen=函数(){
var popID=$(this.attr('rel');//获取弹出窗口名称
var popURL=$(this.attr('href');//获取Popup href以定义大小
//从href URL提取查询变量(&V)
var query=popURL.split(“?”);
var dim=query[1]。拆分('&');
var popWidth=dim[0]。拆分('=')[1];//获取第一个查询字符串值
//淡入弹出窗口并添加关闭按钮
$('#'+popID).fadeIn('slow').css({'width':Number(popWidth)}).prepend('');
//定义中心对齐的边距(垂直-水平)-我们向高度/宽度添加80px,以适应css中定义的填充和边框宽度
var popMargTop=($('#'+popID).height()+20)/2;
var popMargLeft=($('#'+popID).width()+20)/2;
//将边距应用于弹出窗口
$('#'+popID).css({
“页边距顶部”:-popMargTop,
“左边距”:-popMargLeft
});
//淡入背景
$('body').append(“”);//将淡入淡出层添加到body标记的底部。
$('#fade').css({'filter':'alpha(opacity=80)}).fadeIn();//淡入淡入淡入层-.css({'filter':'alpha(opacity=80)})用于修复淡入透明胶片上的IE错误
};
$('a.poplight[href=#?w=400]')。popOpen();//加载后运行popOpen函数
//关闭弹出窗口和淡入层
//$('a.close,#fade').live('click',function(){//单击关闭或淡入淡出层时。。。
$('a.close').live('click',function(){//单击关闭按钮时。。。
$('#淡入,.popup#u块')。淡出(函数(){
$(“#淡入,a.close”).remove();//将它们淡出
location.reload();//重新加载页面
});
返回false;
});
爆米花
});
在首次显示弹出窗口时设置cookie。然后在再次显示之前,请在显示之前检查cookie是否存在
$(document).ready(function(){
if (cookie is set){
return ;
}
show cookie code
then mark cookie as set
});
单击实际链接以关闭弹出窗口,其中可能包含一个#sign as href,它会导致浏览器重新加载页面。请尝试类似的方法关闭该功能
$('a.close').live('click', function(e) { //When clicking on the close...
e.preventDefault();
$('#fade , .popup_block').fadeOut(function() {
$('#fade, a.close').remove(); //fade them both out
location.reload(); // reload page
});
return false;
});
这会阻止链接执行其默认操作,并会导致加载时弹出窗口仅显示一次是否有输入错误?在标记前的最后一行是否打开了弹出窗口