کد ایجاد پرده باز شو در ابتدای لود سایت

کد ایجاد پرده باز شو در ابتدای لود سایت با این کد شما در ابتدای لود سایت خود میتوانید از یک پرده رنگی ساده و دلنشین استفاده کنید.در کد میتوانید سرعت محو شدن پرده رنگی و ترکیب رنگها را تغییر دهید تا به دلخواه شما در بیاد.

 

پرده باز شو سایت

دمو کد

<div style="position:absolute;top:-200%;"><h1><a href="https://www.codebazan.ir/">&#1705;&#1583;&#1576;&#1575;&#1586;&#1575;&#1606;</a></h1></div>

<style>
<!--
.intro{
position:fixed;
left:0;
top:0;
layer-background-color:red;
background-color:#006666;
border:8px solid yellow    ;
z-index:10;
}
-->
</style>           

<div id="i1" class="intro"></div><div id="i2" class="intro"></div>
<script>

var speed=5
var temp=new Array()
var temp2=new Array()

var clipbottom=(window.innerHeight)?parseInt(window.innerHeight)/2:document.body.offsetHeight/2
cliptop=0
for (i=1;i<=2;i++){
temp[i]=document.getElementById("i"+i).style
temp[i].width=(window.innerWidth)?(window.innerWidth-15) + 'px' :document.body.clientWidth + 'px'
temp[i].height=(window.innerWidth)?window.innerHeight/2 + 'px' :document.body.offsetHeight/2 + 'px'
temp[i].top=(i-1)*parseInt(temp[i].height) + 'px'
}

function openit(){
clipbottom-=speed
temp[1].clip="rect(0 auto "+clipbottom+"px 0)"
cliptop+=speed
temp[2].clip="rect("+cliptop+"px auto auto auto)"
if (clipbottom<=-5){
clearInterval(stopit)
temp[1].display="none"
temp[2].display="none"
}  
}
function codebazan(){
stopit=setInterval("openit()",100)
}
codebazan()
  
</script>

 

8 Comments

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *