نمایش نتایج 1 تا 6 از 6

نام تاپیک: ticker

  1. #1

    ticker

    سلام
    کسی 1 نمونه ticker سراغ داره ؟
    از راست به چپ

  2. #2
    کاربر دائمی آواتار soroush.r70
    تاریخ عضویت
    فروردین 1389
    محل زندگی
    مازندران - آمل
    پست
    1,157

    نقل قول: ticker

    بگیر داداش عالیه
    فایل های ضمیمه فایل های ضمیمه

  3. #3

    نقل قول: ticker

    نقل قول نوشته شده توسط soroush.r70 مشاهده تاپیک
    بگیر داداش عالیه
    سلام

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

  4. #4
    کاربر دائمی آواتار mohsen6500
    تاریخ عضویت
    شهریور 1389
    محل زندگی
    آبادان
    سن
    37
    پست
    589

  5. #5

    نقل قول: ticker

    من این کد رو تغییر دادم

    ولی فقط 1 رکورد چاپ و تکرار میکنه و رکوردهای دیگه رو نمایش نمیده
    کد HTML:
    <?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>

  6. #6

    نقل قول: ticker

    با سلام، دوست عزیز، دستور ;0 = i$ رو از حلقه while بیارین بیرون و قبلش بگذارین.
    موفق باشید.

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •