كود اجاكسي لإضافة اخر عشر مواضيع او شريط الاهداء مميز جدا

SH3A3-Q

ابو الميرزا
طاقم الإدارة
إنضم
14 نوفمبر 2007
المشاركات
48,682
النقاط
113
العمر
49
الإقامة
QATIF-القطيف
بسم الله الرحمن الرحيم
السلام عليكم ورحمة الله وبركاته
اخواني انا اول مره اضع درس او كواد في هذا الممنتدى وما اعرف وين اضيفه يعني رجاء نقله للمكان
الصحيح
المهم
عندي لكم كود طازه بتاريخ
May 05, 2009, 09:13:14 AM
وضيفة كود الاجاكسي هذا هو شريط متحرك سلس جدا جدا جدا عن واقع تجربه والان بركبه في موقع من مواقعي
بالطبع الكود كثير بحث عنه قبل كذا ومن ضمنهم انا ولكن هنالك ناس يخبون المعلومات الله اعلم ايش مقصدهم
رمز PHP:

var
themessagefile = "http://www.YourSite.com/ticker/messagefile.php";
var
marqueecontent = 'Loading...'
var marqueespeed=1
var pauseit=1
var marqueebgcolor="threedface"
var marqueeheight="20px"
var minterval = 3;
var
_mInterval;
var
iesux = 1;
var
lefttime

function update_ticker() {
clearInterval(lefttime);
clearInterval(_mInterval);
var
mhttp;

try {
mhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (
e) {
try {
mhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (
E) {
mhttp = false;
}
}
if (!
mhttp && typeof XMLHttpRequest!='undefined') {
mhttp = new XMLHttpRequest();
iesux = 0;
}

if(!
mhttp) {
return
false;
}

mhttp.onreadystatechange=function() {
if (
mhttp.readyState==4) {
if(
mhttp.responseText) {
marqueecontent = ''+mhttp.responseText+'';

if(
document.layers){
ns_marquee.document.getElementById("temp").innerHTML = marqueecontent;
actualwidth=ns_marquee.document.getElementById("temp").width
} else {
cross_marquee.innerHTML = marqueecontent;
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
actualwidth=cross_marquee.offsetWidth;
}
clearInterval(_mInterval);
//actualwidth = 300;
lefttime=setInterval("scrollmarquee()",20);
}
}
}
mhttp.open("POST", themessagefile ,true);
try {
mhttp.setRequestHeader('X-Referer', document.location);
} catch (
e) {
//alert(e);
}

if(
iesux) {
// alert("iesux");
mhttp.send()
} else {
// alert("crapzilla");
mhttp.send(null)
}
return
true;
}

marqueecontent = ''+marqueecontent+'';

marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS

var marqueewidth=document.body.clientWidth;

var
copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write(''+marqueecontent+''
)
var
actualwidth=''
var cross_marquee, ns_marquee

function populate(){
if (
iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee
.style.left=parseInt(marqueewidth)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualwidth
=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
}
else if (
document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee
.left=parseInt(marqueewidth)+8
ns_marquee
.document.write(''+marqueecontent+''</span>)
ns_marquee.document.close()
actualwidth=ns_marquee.document.getElementById("temp").width
}
lefttime=setInterval("scrollmarquee()",20)
}

window.onload=populate

function scrollmarquee(){
if (
iedom){
if (
parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8)){
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
} else {
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
clearInterval(lefttime);
_mInterval = setInterval("update_ticker()",minterval * 1000);
}
} else if (
document.layers){
if (
ns_marquee.left>(actualwidth*(-1)+8)){
ns_marquee.left-=copyspeed
} else {
ns_marquee.left=parseInt(marqueewidth)+8
clearInterval
(lefttime);
_mInterval = setInterval("update_ticker()",minterval * 1000);
}
}
}

if (
iedom||document.layers){
with (document){
document.write('')
if (
iedom){
write('')
write('')
write('

'
)
write('

'
)
}
else if (
document.layers){
write('')
write('')
write('')
}
document.write('')
}
}





</span>
</div></div>كل اللي عليكم تغيرونه هو تشيلون الرابط الموجود بالرابط الخاص بكم شريط الاهداء اخر عشره مواضيع بكيفكم وهو قابل للتطوير
الكود اللي ظروري تغيره هو
رمز PHP:
var themessagefile = "http://www.YourSite.com/ticker/messagefile.php";


يعني غير الرابط
http://www.YourSite.com/ticker/messagefile.php
الا رابط موقعك وخلاص

وكمان تقدر مع شويت تطوير جلب بس الكتابه من اي موقع اخباري مع تعديل بسيط
فكرو فيها واطرحو افكاركم هنا وياليت لو شخص فيكم طور الكود يضيف هنا



تكفون ادعولي بالخير ولوالدي</div>
 
عودة
أعلى أسفل