برگزیده های پرشین تولز

preloader براي وبلاگ

amir_

کاربر قدیمی پرشین تولز
تاریخ عضویت
19 دسامبر 2002
نوشته‌ها
922
لایک‌ها
42
محل سکونت
Dubai-Qom
ديدم بعضي وبلاگها يك preloader گذاشتن كه وبلاگ كامل load بشه.بعد نمايش داده بشه.
مي خواستم بپرسم كد اين preload كه فكر مي كنم با جاوا باشه چيه؟
 

experience

Guest
تاریخ عضویت
18 سپتامبر 2003
نوشته‌ها
132
لایک‌ها
4
من اين چيز رو نديدم ولي در مورد وبلاگ همه سعي مي كنند هر چي اومد نشان داده بشه نه اينكه طرف كلي صبر كنه كل صفحه لود بشه.
استفاده از تگ <div> يكي از فلسفه هاش همينه .
در مورد تصاويري كه با rollover تغيير مي كنند يك خط كوتاه اضافه كني درست مي شه.
 

explorer5

کاربر تازه وارد
تاریخ عضویت
27 جولای 2003
نوشته‌ها
266
لایک‌ها
1
دقيق منظورت رو نفهميدم به هر حال من اين اسكريپت رو معرفي ميكنم.
اگر حجم وبلاگ يا سايتت بالا باشه ميتوني از اين كد جاوا اسكريپت استفاده كنيد.
فقط يك قسمتي رو بايد تغيير بدي
ببين بايد ادرس وب خودت رو بهش اضافه كني به اين صورت
پس بجاي web url ادرس مورد نظر خودت رو بنويس اينحوري بازديد كننده اينحوري يك لودينگ به صفحه اول سايتت اضافه ميشه
اين هم كدش

[code:1]

&#60;html&#62;



&#60;body&#62;



&#60;p align=&#34;center&#34;&#62;&#60;strong&#62;&#60;font face=&#34;Arial&#34;&#62;&#60;big&#62;Please wait &#60;br&#62;

&#60;/big&#62;&#60;/font&#62;&#60;/strong&#62;&#60;/p&#62;



&#60;script&#62;



//specify redirect url

var redirecturl=&#34;web url&#34;

//specify pause duration before redirection &#40;in seconds&#41;

var pausefor=5



//DONE EDITING



function postaction&#40;&#41;&#123;

if &#40;window.timer&#41;&#123;

clearInterval&#40;timer&#41;

clearInterval&#40;timer_2&#41;

&#125;

window.location=redirecturl

&#125;

setTimeout&#40;&#34;postaction&#40;&#41;&#34;,pausefor*1000&#41;



&#60;/script&#62;





&#60;!--&#91;if IE&#93;&#62;



&#60;script language=&#34;JavaScript1.2&#34;&#62;



&#60;!--



// this script was originally authored by william kemper. &nbsp;I have no homepage.

var switchm=new Array

switchm&#91;0&#93;=&#34;ffaa00&#34;;

switchm&#91;1&#93;=&#34;ffff00&#34;;

switchm&#91;2&#93;=&#34;00ff00&#34;;

switchm&#91;3&#93;=&#34;0099ff&#34;;

switchm&#91;4&#93;=&#34;ff0000&#34;;

switchm&#91;5&#93;=&#34;ff00ff&#34;;

// if you want to add more colors go ahead, all the for limits are based on array length so

// you shouldn't need to change any of the code, just add more colors.



i=0

j=0

function STROBE&#40;&#41;

&#123;

if &#40;j&#62;increment.length-1&#41;

&#123;

j=0

i++

&nbsp;if &#40;i&#62;switchm.length-1&#41;

&nbsp;&#123;

&nbsp;i=0

&nbsp;&#125;

&#125;

document.all.increment&#91;j&#93;.filters.blendTrans.apply&#40;&#41;

document.all.increment&#91;j&#93;.bgColor=switchm&#91;i&#93;

document.all.increment&#91;j&#93;.filters.blendTrans.play&#40;&#41;

j++

&#125;

timer=setInterval&#40;&#34;STROBE&#40;&#41;&#34;,20&#41; // change the number to effect the speed of the loadbar.

timer_2=setInterval&#40;&#34;REVEAL&#40;&#41;&#34;,20&#41;

function REVEAL&#40;&#41;

&#123;

if &#40;document.images&#91;0&#93;.complete&#41;

&nbsp;&#123;

&nbsp;clearInterval&#40;timer&#41;

&nbsp;clearInterval&#40;timer_2&#41;

&nbsp;document.all.loadbar.style.visibility=&#34;hidden&#34;;

&nbsp;document.all.content.style.visibility=&#34;visible&#34;;

&nbsp;&#125;

&#125;

// i don't know how to put comments in the css, but change duration to &nbsp;effect the speed of the fade effect.







//--&#62;

&#60;/script&#62;

&#60;style&#62;&#60;!--

body

&#123;

font-size&#58;12px;

font-family&#58;Arial;

color&#58;000000

&#125;

#increment

&#123;

filter&#58;blendTrans&#40;duration=1&#41;

&#125;

--&#62;

&#60;/style&#62;



&#60;!&#91;endif&#93;--&#62;



&#60;!--&#91;if IE&#93;&#62;



&#60;div id=loadbar

style=position&#58;absolute;top&#58;expression&#40;document.body.clientHeight/2-100&#41;;left&#58;expression&#40;document.body.clientWidth/2-50&#41;&#62;

&#60;table cellspacing=0 cellpadding=0 width=100&#62;&#60;tr&#62;&#60;td

colspan=10&#62;&#60;b&#62;Loading...&#60;/b&#62;&#60;/td&#62;&#60;/tr&#62;&#60;tr&#62;

&#60;script language=&#34;JavaScript&#34;&#62;&#60;!--

for &#40;k=0;k&#60;10;k++&#41;

&#123;

document.write&#40;&#34;&#60;td id=increment width=10 height=20&#62;&#60;/td&#62;&#34;&#41; // you could set &nbsp;the length of the loadbar by changing the upper limit of the for statement.

&#125;

//--&#62;&#60;/script&#62;

&nbsp;&#60;/tr&#62;&#60;/table&#62;

&#60;/div&#62;

&#60;div id=content

style=&#34;position&#58;absolute;top&#58;expression&#40;&#40;document.body.clientHeight-document.images&#91;0&#93;.height&#41;/2&#41;;left&#58;expression&#40;&#40;document.body.clientWidth-document.images&#91;0&#93;.width&#41;/2&#41;;visibility&#58;hidden;&#34;&#62;

&#60;img src=placeholder.gif width=1 height=1&#62;

&#60;/div&#62;



&#60;!&#91;endif&#93;--&#62;



&#60;/body&#62;

&#60;/html&#62;

[/code:1]
 
بالا