PDA

View Full Version : ticker



rash44
جمعه 09 دی 1390, 15:56 عصر
سلام
کسی 1 نمونه ticker سراغ داره ؟
از راست به چپ

soroush.r70
جمعه 09 دی 1390, 16:22 عصر
بگیر داداش عالیه

rash44
شنبه 10 دی 1390, 11:39 صبح
بگیر داداش عالیه

سلام

این کد php جواب نداد

mohsen6500
شنبه 10 دی 1390, 12:00 عصر
سلام اینو نیگا بنداز (http://barnamenevis.org/showthread.php?262375-%D8%A7%D8%B3%D9%83%D8%B1%D9%8A%D9%BE%D8%AA-%D8%A7%D9%85%D8%A7%D8%AF%D9%87-%D8%A8%D8%B1%D8%A7%D9%8A-%D9%86%D9%85%D8%A7%D9%8A%D8%B4-%D8%AE%D8%A8%D8%B1%D9%87%D8%A7-%D8%A8%D9%87-%D8%B5%D9%88%D8%B1%D8%AA-%D8%AA%D8%A7%D9%8A%D9%BE/page3&highlight=%D8%AE%D8%A8%D8%B1+%D8%AA%D8%A7%DB%8C%D9 %BE)

rash44
شنبه 10 دی 1390, 13:02 عصر
من این کد رو تغییر دادم

ولی فقط 1 رکورد چاپ و تکرار میکنه و رکوردهای دیگه رو نمایش نمیده

<?php
mysql_connect('localhost', 'root', '') or die('Connection error');
mysql_select_db('slide') or die('Database does not exist');
$q = mysql_query('SELECT * FROM `slide` ORDER BY `id` DESC LIMIT 5');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>
<body>
<div class=ticki>
<p dir=rtl>
<font style="FONT-SIZE: 8pt" face=Tahoma color="#3366ff"><span id=theTicker></span></font>
<script type="text/javascript">
var theSummaries = new Array();
var theSiteLinks = new Array();
<?php
while($line = mysql_fetch_assoc($q)) { $i=0; ?>
theSummaries[<?php echo $i; ?>]= "<?php echo $line['txt']; ?>";
<?php
$i++;
}
?>
var theCharacterTimeout = 50;
var theStoryTimeout = 5000;
var theWidgetOne = "_";
var theWidgetTwo = "-";
var theWidgetNone = "";
var theItemCount = theSummaries.length;
var NS6=(document.getElementById && !document.all) ? true : false;
function startTicker(){
theCurrentStory = -1;
theCurrentLength = 0;
if (document.getElementById){
runTheTicker();
}
else{
document.write("<style>.ticki{display:none;}.ticko{border:0px; padding:0px;}</style>");
return true;
}
}
function runTheTicker(){
var myTimeout;
if(theCurrentLength == 0){
theCurrentStory++;
theCurrentStory = theCurrentStory % theItemCount;
theStorySummary = theSummaries[theCurrentStory];
theTargetLink = theSiteLinks[theCurrentStory];
}
var textTitle = theStorySummary.substring(0,theCurrentLength) + whatWidget();
if (theTargetLink ){
if (NS6){
document.getElementById("theTicker").innerHTML = '<a target="_blank" href='+theTargetLink+'>'+textTitle+'</a>';
}
else{
document.all.theTicker.innerHTML = '<a target="_blank" href='+theTargetLink+'>'+'<font face="Tahoma" style="font-size: 8pt"><span style="text-decoration: none">'+textTitle+'</span></font>'+'</a>';
}
}
else {
if (NS6){
document.getElementById("theTicker").innerHTML = '<a target="_blank" href='+theTargetLink+'>'+'<span class="tickertext">'+textTitle+'</span>'+'</a>';
}
else{
document.all.theTicker.innerHTML = '<a target="_blank" href='+theTargetLink+'>'+'<span class="tickertext">'+textTitle+'</span>'+'</a>';

}
}
if(theCurrentLength != theStorySummary.length){
theCurrentLength++;
myTimeout = theCharacterTimeout;
}
else{
theCurrentLength = 0;
myTimeout = theStoryTimeout;
}
setTimeout("runTheTicker()", myTimeout);
}
function whatWidget(){
if(theCurrentLength == theStorySummary.length){
return theWidgetNone;
}
if((theCurrentLength % 2) == 1){
return theWidgetOne;
}
else{
return theWidgetTwo;
}
}
startTicker();
</script>
</p></div>

</body>

</html>

MMSHFE
یک شنبه 11 دی 1390, 11:13 صبح
با سلام، دوست عزیز، دستور ;0 = i$ رو از حلقه while بیارین بیرون و قبلش بگذارین.
موفق باشید.