2013-04-08 5 views
-2

Я пытаюсь сделать текст внутри JQuery slideup скатиться запрос, но когда я добавляю другой код JQuery это показывает, что этоJquery внутри от Jquery

​ 

Так вот мой код

<head> 
     <script type="text/javascript"> 
<!-- HIDE FROM INCOMPATIBLE BROWSERS 
var fish1Position = 0; 
var fish2Position = 0; 
var fish3Position = 99; 
var horizontal = []; 
var fillPosition = 10; 
var num = 100; 
for(var i = 0; i < 100; ++i) { 
     horizontal[i] = fillPosition; 
     fillPosition += 10; 
} 

function fish1Swim() { 
     document.getElementById("fish1").style.left = horizontal[fish1Position] + "px"; 
     ++fish1Position; 
     if (fish1Position == num) { 
       fish1Position = 0; 
} 
var tim1 = setTimeout(fish1Swim, 100); 
} 
function fish2Swim(){ 
     document.getElementById("fish2").style.left = horizontal[fish2Position] + "px"; 
     ++fish2Position; 
     if (fish2Position == num) { 
       fish2Position = 0; 
} 
var tim2 = setTimeout(fish2Swim, 200); 
} 

function fish3Swim() { 
    document.getElementById("fish3").style.left = horizontal[fish3Position] + "px"; 
    ++fish3Position; 
    if (fish3Position == num) { 
fish3Position = 99; 
} 
var tim3 = setTimeout(fish3Swim, 300); 
} 

function startSwimming() { 
     fish1Swim(); 
     fish2Swim(); 
     fish3Swim(); 
} 

// STOP HIDING FROM INCOMPATIBLE BROWSERS --> 
</script> 
</head> 
//////////////////////////////////////////////////////////// 
///////////////////////////////////////////////////////// 
////////////////////////////////////////////////////////// 
///////////////////////////////////////////////////////////// 
<body> 
<ul> 
<li><img src='http://station2k.com/blank-hockey-puck.png' width='17px' height='17px'> {$nhlteam} ​<span id='fish1'>{$nhlmessage}</span></li> 
<li><img src='http://station2k.com/blank-hockey-puck.png' width='17px' height='17px'> {$nhlteam} ​<span id='fish1'>{$nhlmessage}</span></li> 
</ul> 
///////////////////////////////////////////////////////////////// 
//////////////////////////////////////////////////////////////// 
/////////////////////////////////////////////////////////////// 
////////////////////////////////////////////////////////////// 
<!-- include jQuery core code --> 
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> 
<script> 
$(document).ready(function() { 
    function textloop() { 
    // get the item that currently has the 'show' class 
    var current = $('#items .show'); 
    /* 
    * find the next item with some help from jQuery's ternary operator 
    * the syntax for the ternary operator is 'a ? b : c' 
    * in other words 'if a is true return b otherwise return c' 
    */ 
    var next = current.next().length ? current.next() : current.parent().children(':first'); 
    // fade out the current item and remove the 'show' class 
    current.delay(5000).slideUp('slow',function(){ 
     // fade in the next item and add the 'show' class 
     next.slideDown('slow').addClass('show'); 
    }).removeClass('show'); 

    // repeat by calling the textloop method again after 3 seconds 
    setTimeout(textloop,0); 
    } 

    // call the text loop method when the page loads 
    textloop(); 
}); 
</script> 

Любая помощь по созданию текста в списках прокрутки? прив в теге, что я могу идентификатор, как я не хочу, чтобы весь сценарий прокрутки справа налево

+0

Вы пытались подключиться к внешним скриптам, а не встраивать – Jlange

+0

нет. Я попробую это –

+0

. Я бы обернул тег скрипта вокруг диапазона? –

ответ

0

Попробуйте изменить свой выход значения PHP для этого:

<li><img src='http://station2k.com/blank-hockey-puck.png' width='17px' height='17px'><?php echo $nhlteam ?>​<span id='fish1'><?php echo $nhlmessage ?></span></li> 

Символа вы видите это представление ASCII указателя памяти на вашу переменную.

+0

Я сделал это сейчас, это не повторяет строку lol, и я знаю, что там что-то есть в строке ..... grrr Я проголосовал за вопрос хорошего вопроса. Спасибо за вашу помощь! –

Смежные вопросы