PDA

عرض كامل الموضوع : مؤثرات شريط المعلومات || أكواد جافا سكربت


Mahmoud Hamed
15th December 2015, 06:39 PM
كلمات تظهر في شريط المعلومات السفلي 1



طريقة التركيب

1- انسخ هذا الكود و ضعه في منطقة HEAD
<script LANGUAGE="JavaScript">

/* Visit our site at http://www.star28.com/ for more code
*/

var init_msg = "Welcome To STAR28.com"

var str = ""
var msg = ""
var leftmsg = ""


function setMessage()
{
if (msg == "")
{
str = " "
msg = init_msg
leftmsg = ""
}

if (str.length == 1)
{

while (msg.substring(0, 1) == " ")
{
leftmsg = leftmsg + str
str = msg.substring(0, 1)
msg = msg.substring(1, msg.length)
}
leftmsg = leftmsg + str
str = msg.substring(0, 1)
msg = msg.substring(1, msg.length)
for (var ii = 0; ii < 120; ii++)
{str = " " + str}
}
else
{
str = str.substring(10, str.length) // decrease str little by little
}


window.status = leftmsg + str
JSCTimeOutID = window.setTimeout('setMessage()',100)
}

</script>


2- ضع هذه الرموز ضمن الوسم BODY لتصبح هكذا
<BODY onLoad="JSCTimeOutID = window.setTimeout('setMessage()',500);">

Mahmoud Hamed
15th December 2015, 06:41 PM
كلمات تظهر في شريط المعلومات السفلي 2


طريقة التركيب

1- انسخ هذا الكود و ضعه في منطقة HEAD
<script LANGUAGE="JavaScript">

/* Visit our site at http://www.star28.com/ for more code
* This notice must stay intact for use */

<!-- Begin
var Message="مرحبا بكم في ";
var place=1;
function scrollIn() {
window.status=Message.substring(0, place);
if (place >= Message.length) {
place=1;
window.setTimeout("scrollOut()",300);
} else {
place++;
window.setTimeout("scrollIn()",50);
}
}
function scrollOut() {
window.status=Message.substring(place, Message.length);
if (place >= Message.length) {
place=1;
window.setTimeout("scrollIn()", 100);
} else {
place++;
window.setTimeout("scrollOut()", 50);
}
}
// End -->
</script>


2- ضع هذه الرموز ضمن الوسم BODY لتصبح هكذا
<BODY onLoad="scrollIn()">

Mahmoud Hamed
15th December 2015, 06:42 PM
كلمات تظهر في شريط المعلومات السفلي 3


طريقة التركيب

1- انسخ هذا الكود و ضعه في منطقة HEAD
<script LANGUAGE="JavaScript">

/* Visit our site at http://www.star28.com/ for more code
* This notice must stay intact for use */

<!-- Begin
function scrollit(seed) {
var m1 = "ضع هنا";
var m2 = "---- الرسائل ----";
var m3 = "التي تريد ظهورها";
var m4 = "---- يمكنك التحكم في عدد الرسائل ---";
var msg=m1+m2+m3+m4;
var out = "كلام ثابت ";
var c = 1;
if (seed > 100) {
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
}
}
}
// End -->
</script>


2- ضع هذه الرموز ضمن الوسم BODY لتصبح هكذا
<BODY onLoad="scrollit(100)">

Mahmoud Hamed
15th December 2015, 06:43 PM
كلمات تظهر في شريط المعلومات السفلي 4

طريقة التركيب

انسخ هذا الكود و ضعه في منطقة BODY
<script LANGUAGE="JavaScript">
<!--// 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 http://www.geocities.com/SiliconValley/9000/
// For more information contact Tomer or Yehuda Shiran <yshiran@iil.intel.com>
// Translated By http://soft.vip600.com/
/* Visit our site at http://www.star28.com/ for more code */

// 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] = "و شكراً لزيارتكم"

// 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.length; ++j) {
// if character at index j of current message has not been placed in displayed string
if (state.charAt(j) == 0)
full = false
}
// return true immediately if no space found (avoid infinitive loop later)
if (full) return true
// search for random until free space found (braoken up via break statement)
while (1) {
// a random number (between 0 and state.length - 1 == message.length - 1)
var num = getRandom(ar[message].length)
// if free space found break infinitive loop
if (state.charAt(num) == "0")
break
}
// replace the 0 character with 1 character at place found
state = state.substring(0, num) + "1" + state.substring(num + 1, state.length)
// return false because the string was not full (free space was found)
return false
}

function getRandom(max) {
// create instance of current date
var now = new Date()
// create a random number (good generator)
var num = now.getTime() * now.getSeconds() * Math.random()
// cut random number to value between 0 and max - 1, inclusive
return num % max
}
startBanner()
// -->
</script>

Mahmoud Hamed
15th December 2015, 06:45 PM
كلمات تظهر في شريط المعلومات السفلي 5

طريقة التركيب

انسخ هذا الكود و ضعه في منطقة HEAD
<script language="JavaScript"> /* Visit our site at http://www.star28.com/ for more code */ <!-- var x = 0 var speed = 300 var text = "أهلاً و سهلاً بكم" function Blinky() { window.status = text setTimeout("Blinky2()", speed) } function Blinky2() { window.status = " " setTimeout("Blinky()", speed) } Blinky() //--> </script>

Mahmoud Hamed
16th December 2015, 02:29 PM
كلمات تظهر في شريط المعلومات السفلي 5

طريقة التركيب

انسخ هذا الكود و ضعه في منطقة HEAD
<script language="JavaScript">

/* Visit our site at http://www.star28.com/ for more code
*/
<!--

var x = 0
var speed = 300
var text = "أهلاً و سهلاً بكم"

function Blinky() {
window.status = text
setTimeout("Blinky2()", speed)
}

function Blinky2() {
window.status = " "
setTimeout("Blinky()", speed)
}

Blinky()
//-->

</script>

Mahmoud Hamed
16th December 2015, 02:30 PM
كلام ثابت في شريط المعلومات السفلي

طريقة التركيب

1- انسخ هذا الكود و ضعه في منطقة HEAD
<script LANGUAGE="JavaScript">

/* Visit our site at http://www.star28.com/ for more code
* This notice must stay intact for use */
<!--
// Following COPYRIGHT ©1997 Dennis & Family. All Rights Reserved.
function snapIn(jumpSpaces,position) { var msg = "ضع الكلام الذي تريده هنا"; var out = ""; for (var i=0; i<position; i++) { out += msg.charAt(i) } for (i=1;i<jumpSpaces;i++) { out += " " } out += msg.charAt(position); window.status = out; if (jumpSpaces <= 1) { position++; if (msg.charAt(position) == ' ') { position++ } jumpSpaces = 100-position } else if (jumpSpaces > 3) { jumpSpaces *= .09 } else { jumpSpaces-- } if (position != msg.length) { var cmd = "snapIn(" + jumpSpaces + "," + position + ")"; window.setTimeout(cmd,10); } return true }
//-->

</script>


2- ضع هذه الرموز ضمن الوسم BODY لتصبح هكذا
<BODY onLoad="snapIn(50,0)">

Mahmoud Hamed
16th December 2015, 02:31 PM
التاريخ و الوقت في شريط المعلومات السفلي 1

طريقة التركيب

1- انسخ هذا الكود و ضعه في منطقة HEAD
<script LANGUAGE="JavaScript">

/* Visit our site at http://www.star28.com/ for more code
<!-- Original: Francis Woodhouse (francis@contessa.u-net.com) --> */
<!-- Begin
function runClock() {
theTime = window.setTimeout("runClock()", 1000);
var today = new Date();
var display= today.toLocaleString();
status=display;
}
// End -->
</script>


2- ضع هذه الرموز ضمن الوسم BODY لتصبح هكذا
<BODY onLoad="runClock()">

Mahmoud Hamed
16th December 2015, 02:32 PM
ساعة تظهر في شريط المعلومات السفلي
طريقة التركيب

انسخ هذا الكود و ضعه في منطقة BODY
<script language="JavaScript"><!--
var timerID = null;
var TimerRunning = false;
function stop(){
if(TimerRunning)
clearTimeout(timerID);
TimerRunning = false;
}
function display() {
var thedate = new Date();
var hours = thedate.getHours();
var Min = thedate.getMinutes();
var Sec = thedate.getSeconds();
var TimeV = "" + ((hours >12) ? hours -12 :hours)
TimeV += ((Min < 10) ? ":0" : ":") + Min
TimeV += ((Sec < 10) ? ":0" : ":") + Sec
TimeV += (hours >= 12) ? " PM" : " AM"
window.status = TimeV;
timerID = setTimeout("display()",1000);
TimerRunning = true;
}
function start() {
stop();
display();
}
start();
// end hide
// --></script>

Mahmoud Hamed
16th December 2015, 02:32 PM
ظهور شرح للرابط في الشريط السفلي

طريقة التركيب

ضع هذا الكود بعد الوسم BODY في المكان الذي تريده
<a target="_blank" onMouseOver="window.status='ضع هنا وصف الرابط';return true" onMouseOut="window.status='';return true" href="ضع هنا رابط URL">اسم الرابط</a>

Mahmoud Hamed
16th December 2015, 02:33 PM
كلام متحرك يظهر في البار العلوي للصفحة

طريقة التركيب

انسخ هذا الكود و ضعه في منطقة HEAD
<script language="JavaScript1.2">
// ************************************************** *****************
// script by drevil_nz, Michael Dillon, Christchurch New Zealand.
// Permission granted to use this script provided this credit
// remains intact. Visit my homepage www.chc.quik.co.nz/juggler/mikey.html
// Script written for Internet Explorer 4.0+.
// ************************************************** *****************

var message="مرحباً بكم فى موقعنا" //specifys the title
var message=message+" " //gives a pause at the end,1 space=1 speed unit, here I used 10 spaces@150 each = 1.5seconds.
i="0" //declares the variable and sets it to start at 0
var temptitle="" //declares the variable and sets it to have no value yet.
var speed="150" //the delay in milliseconds between letters

function titler(){
if (!document.all&&!document.getElementById)
return
document.title=temptitle+message.charAt(i) //sets the initial title
temptitle=temptitle+message.charAt(i) //increases the title by one letter
i++ //increments the counter
if(i==message.length) //determines the end of the message
{
i="0" //resets the counter at the end of the message
temptitle="" //resets the title to a blank value
}
setTimeout("titler()",speed) //Restarts. Remove line for no-repeat.
}

window.onload=titler
</script>