عرض مشاركة مفردة
 
  #1  
قديم 06-11-2007, 09:04 AM
الصورة الشخصية لـ athari
athari athari غير متصل
عضو
 
تاريخ التسجيل: Aug 2007
مشاركة: 309
مستوى تقييم العضوية: 0
athari is an unknown quantity at this point
Awt1 سكربت تغيير الكلام مع الرابط بشكل رائع !

السلام عليكم ،


اليوم أقدم لكم سكربت جميل جداً ، اقتبسته من أحد المواقع الأجنبية ، ولفتني جمال السكربت حين تختفي وتظهر الكلمات بشكل رائع وجذاب فيه !

لا أطيل عليكم ، هذا هو السكربت :


كود:
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<title>صفحة جديدة 1</title>
</head>

<body>
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
<link type="text/css" rel="stylesheet" href="/ptnr/common/ticker.css" />
</head>

<body>
<div class="ticki"><a id="tickerAnchor" href="#" target="_top" class="tickl"></a></div>
<script language="JavaScript" type="text/javascript">
<!--
// Ticker startup
function startTicker()
{
	// Define run time values
	theCurrentStory     = -1;
	theCurrentLength    = 0;
	// Locate base objects
	if (dcidcidcidocument.getElementById) {	
		    theAnchorObject     = dcidcidcidocument.getElementById("tickerAnchor");
			runTheTicker();   	
		 }
	else {
            dcidcidcidocument.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
            return true;
	}
}
// Ticker main run loop
function runTheTicker()
{
	if (theCurrentStory == -1) {
		// Start on a random story.
		theCurrentStory = Math.round(Math.random(theItemCount-1));
	}

	var myTimeout;  
	// Go for the next story data block
	if(theCurrentLength == 0)
	{
		theCurrentStory++;
		theCurrentStory      = theCurrentStory % theItemCount;
		theStorySummary      = theSummaries[theCurrentStory].replace(/&quot;/g,'"');		
		theTargetLink        = theSiteLinks[theCurrentStory];
		theAnchorObject.href = theTargetLink;
		thePrefix 	     = "<span class=\"tickls\">" + theLeadString + "</span>";
	}
	// Stuff the current ticker text into the anchor
	theAnchorObject.innerHTML = thePrefix + 
	theStorySummary.substring(0,theCurrentLength) + whatWidget();
	// Modify the length for the substring and define the timer
	if(theCurrentLength != theStorySummary.length)
	{
		theCurrentLength++;
		myTimeout = theCharacterTimeout;
	}
	else
	{
		theCurrentLength = 0;
		myTimeout = theStoryTimeout;
	}
	// Call up the next cycle of the ticker
	setTimeout("runTheTicker()", myTimeout);
}
// Widget generator
function whatWidget()
{
	if(theCurrentLength == theStorySummary.length)
	{
		return theWidgetNone;
	}

	if((theCurrentLength % 2) == 1)
	{
		return theWidgetOne;
	}
	else
	{
		return theWidgetTwo;
	}
}
// -->
</script>
    

	<script language="JavaScript" type="text/javascript">
	<!--

	var theCharacterTimeout = 30;
	var theStoryTimeout     = 5000;
	var theWidgetOne        = "_";
	var theWidgetTwo        = "-";
	var theWidgetNone       = "";
	var theLeadString       = "";

	var theSummaries = new Array();
	var theSiteLinks = new Array();

	var theItemCount = 9;

		theSummaries[0] = "الفقرة الأولى";
		theSiteLinks[0] = "http://www.arabwebtalk.com";
	
		theSummaries[1] = "الفقرة الثانية";
		theSiteLinks[1] = "http://www.arabwebtalk.com";
	
		theSummaries[2] = "الفقرة الثالثة";
		theSiteLinks[2] = "http://www.arabwebtalk.com";

		theSummaries[3] = "الفقرة الرابعة";
		theSiteLinks[3] = "http://www.arabwebtalk.com";

		theSummaries[4] = "الفقرة الخامسة";
		theSiteLinks[4] = "http://www.arabwebtalk.com";

		theSummaries[5] = "الفقرة السادسة";
		theSiteLinks[5] = "http://www.arabwebtalk.com";

		theSummaries[6] = "الفقرة السابعة";
		theSiteLinks[6] = "http://www.arabwebtalk.com";

		theSummaries[7] = "الفقرة الثامنة";
		theSiteLinks[7] = "http://www.arabwebtalk.com";

		theSummaries[8] = "الفقرة التاسعة";
		theSiteLinks[8] = "http://www.arabwebtalk.com";

	startTicker();
	
	//-->
	</script>

أولاً : قم بتغيير التالي :

1) الاسم والرابط :

كود:
theSummaries[0] = "الفقرة الأولى";
		theSiteLinks[0] = "http://www.arabwebtalk.com";

الفقرة الأولى تمثل الفقرة التي تريد وضعها

والرابط وهو عنوان الويب العربي هنا : http://www.arabwebtalk.com يمثل الرابط المراد وضعه .


ثانياً: إضافة عبارات أكثر ( المسموح به حالياً 9 فقرات )

ولفعل ذلك قم بالتالي :

1) تغيير هذا العدد :

كود:
	var theItemCount = 9;
فمثلاً إذا أ ردنا 11 فقرة غير الرقم 9 إلى الرقم 11 في هذا الكود من السكربت .

2) قم بإضافة هذا الكود نهاية الكود رقم (8) والذي يمثل العدد التاسع من الفقرات ، لأنها تبدأ من الصفر !

كود:
theSummaries[8] = "الفقرة التاسعة";
		theSiteLinks[8] = "http://www.arabwebtalk.com";
مع تغيير الرقم 8 إلى ما بعده ، وهكذا !

ثالثاً : ولتغيير السرعة قم بتحرير هذا الكود :

كود:
var theCharacterTimeout = 30;
	var theStoryTimeout     = 5000;
	var theWidgetOne        = "_";
	var theWidgetTwo        = "-";
	var theWidgetNone       = "";
	var theLeadString       = "";

فالرقم 30 هو يمثل طابع الخروج
والرقم 5000 يمثل وقت الخروج

هذا ما عندي، والعلم عند الله ، ونرجو من أخينا أبو مساعد إفادتنا اكثر فهو الأبرع هنا بمعرفة هذا الفن.

تنبيه : قمت بإرفاق لكم الكود في النوته ،





الملفات المرفقة
نوع الملف: rar سكربت تغيير الكلام المعدل.rar‏ (الحجم 1.4 ك/بايت , عدد مرات التنزيل : 202)
نوع الملف: txt سكربت تغيير الكلام المعدل.txt‏ (الحجم 3.5 ك/بايت , عدد مرات التنزيل : 142)