PDA

View Full Version : مبتدی: کد جی کویری



lost_z
جمعه 31 مرداد 1393, 15:21 عصر
سلام دوستان کسی میتونه این سورس رو طوری بهینه کنه که پنجره پاپ آپ به صورت خودکار بدون کلیک باز بشه(اتوماتیک).





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" dir="rtl" >
<head>


<script src="jquery-1.5.min.js" type="text/javascript"></script>
<script type="text/javascript">


$(document).ready(function() {

$('a[name=modal]').click(function(e) {
e.preventDefault();
var id = $(this).attr('href');

var maskHeight = $(document).height();
var maskWidth = $(window).width();

$('#mask').css({'width':maskWidth,'height':maskHei ght});

$('#mask').fadeIn(1000);
$('#mask').fadeTo("slow",0.8);

var winH = $(window).height();
var winW = $(window).width();

$(id).css('top', winH/2-$(id).height()/2);
$(id).css('left', winW/2-$(id).width()/2);

$(id).fadeIn(2000);

});

$('.window .close').click(function (e) {
e.preventDefault();
$('#mask, .window').hide();
});

$('#mask').click(function () {
$(this).hide();
$('.window').hide();
});

});
</script>

<style type="text/css">
body
{
font:normal 9pt tahoma;
}
p
{
text-align:center;
margin-top:50px
}
a[name="modal"]
{
text-decoration:none;
font-size:25pt;
}

#mask {
position:absolute;
z-index:9000;
background-color:#000;
display:none;
top:0px;
left:0px

}

#boxes .window {
position:fixed;
width:440px;
height:200px;
display:none;
z-index:9999;
padding:20px;
}

#boxes #dialog {
width:375px;
height:203px;
background:#fff
}

</style>
</head>
<body>
<p>
<a href="#dialog" name="modal">abcd</a>
</p>
<div id="boxes">

<div id="dialog" class="window">


<a href="#" class="close">بستن پنجره</a>

</div>

<div id="mask"></div>
</div>
</body>
</html>

lost_z
شنبه 01 شهریور 1393, 10:35 صبح
کسی نمیتونه این سورسو کمکم کنه؟

دوستان خیلی لازممه.

هرچی گشتم تو سرچ فقط به صورت لینکی بود یا این که چیزی که مد نظرم بود نبود. لطفا یکی یاری کنه.