the empty heart ..::"webmaster"::..
عدد الرسائل : 5154 العمر : 34 تاريخ التسجيل : 03/07/2007
| موضوع: عباره بشريط المعلومات 2 الأحد 23 سبتمبر - 6:10:15 | |
| [/hide] - الكود:
-
<script> <!--// Copyright 1996 - Tomer and Yehuda Shiran // This example will appear in our forthcoming book on JavaScript. // Feel free to "steal" this code provided that you leave this notice as is. // Additional examples from the book can be found at [url=http://www.geocities.com/SiliconValley/9000/]http://www.geocities.com/SiliconValley/9000/[/url] // For more information contact Tomer or Yehuda Shiran <email> //للمزيد من الجافا سكريبت .. نرجو زيارة منتديات الندي [url=http://ELNADA.4UMER.NET/]http://ELNADA.4UMER.NET/[/url] // set speed of banner (pause in milliseconds between addition of new character) var speed = 10 // decrease value to increase speed (must be positive) // set pause between completion of message and beginning of following message var pause = 2500 // increase value to increase pause // set initial values var timerID = null var bannerRunning = false // create array var ar = new Array() // اكتب هنا الجمل التي تود ان تظهر بشريط المعلومات ar[0] = "مرحباً بكم في منتديات الندي لسكريبتات الجافا" ar[1] = "نتمنى ان تجد عزيزي الزائر والزائرة كل ما تبحثون عنه" ar[2] = "تتميز منتديات الندي بوجود اقسام مختلفة مثل:" ar[3] = "الاسلاميات ... والألعاب ... والدروس وشرح البرامج ... وقسم خاص بالماسنجر6 ... والعديد من الصفحات المفيدة" // assign index of current message var message = 0 // empty string initialization var state = "" // no value is currently being displayed clearState() // stop the banner if it is currently running function stopBanner() { // if banner is currently running if (bannerRunning) // stop the banner clearTimeout(timerID) // timer is now stopped timerRunning = false } // start the banner function startBanner() { // make sure the banner is stopped stopBanner() // start the banner from the current position showBanner() } // assign state a string of "0" characters of the length of the current message function clearState() { // initialize to empty string state = "" // create string of same length containing 0 digits for (var i = 0; i < ar[message].length; ++i) { state += "0" } } // display the current message function showBanner() { // if the current message is done if (getString()) { // increment message message++ // if new message is out of range wrap around to first message if (ar.length <= message) message = 0 // new message is first displayed as empty string clearState() // display next character after pause milliseconds timerID = setTimeout("showBanner()", pause) } else { // initialize to empty string var str = "" // built string to be displayed (only character selected thus far are displayed) for (var j = 0; j < state.length; ++j) { str += (state.charAt(j) == "1") ? ar[message].charAt(j) : " " } // partial string is placed in status bar window.status = str // add another character after speed milliseconds timerID = setTimeout("showBanner()", speed) } } function getString() { // set variable to true (it will stay true unless proven otherwise) var full = true // set variable to false if a free space is found in string (a not-displayed char) for (var j = 0; j <state> </script>
[hide] | |
|