[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Смена текста через время
Гость_Александр
Подскажите как можно поменять текст через 3 секунды, желательно на jquery.
Гость_Александр
Не надо что бы менялся все время, один раз только.
Guest
function nextMsg ()  {  if  ( messages . length ==  0 )  
{
/ / once there is no more message, do Whatever you want alert ("redirecting");
} else {
/ / change content of message, fade in, wait, fade out and Continue with the next message
$ ('# message'). html (messages.pop ()). fadeIn (500). Delay (1000). fadeOut (500, nextMsg);}},
/ / list of messages to display var messages = ["Hello", "This is a website!", "You are now going to be redirected.", "Are you ready?", "You're now being redirected ..." ]. Reverse (),
/ / initially hide the message $ ('# message'). Hide (), / / start animation nextMsg ();

Нашел функцию, как сделать что бы только один раз
inpost
Гугли: "js settimeout". Простая функция, которая вызовет твою функцию на замену текста.

_____________
Обучаю веб-программированию качественно и не дорого: http://school-php.com
Фрилансер, принимаю заказы: PHP, JS, AS (видео-чаты). Писать в ЛС (Личные сообщения на phpforum).
johniek_comp

setTimeout(nextMsg (),3000)
function nextMsg () { if ( messages . length == 0 )
{
/ / once there is no more message, do Whatever you want alert ("redirecting");
} else {
/ / change content of message, fade in, wait, fade out and Continue with the next message
$ ('# message'). html (messages.pop ()). fadeIn (500). Delay (1000). fadeOut (500, nextMsg);}},
/ / list of messages to display var messages = ["Hello", "This is a website!", "You are now going to be redirected.", "Are you ready?", "You're now being redirected ..." ]. Reverse (),
/ / initially hide the message $ ('# message'). Hide (), / / start animation nextMsg ();


_____________
user posted image
Guest
Спасибо большое
Guest
У кого-то этот код работает?о0
Guest
success: function(html){
$("#"+(id)).html(html)
setTimeout('$("#"+(id)).html("Priv")',5000);

Ajax jquery, задержка не происходит:( Чего?
jetistyum
попробуй
setTimeout( function(){ $("#"+(id)).html("Priv"); } ,5000);
Guest
Решил уже. Спасибо за старания.
function rating(r, id, ppo) {
function done() {
$("#"+(id)).html("Средняя оценка:" +(ppo))
}
$.ajax({
type: "POST",
url: "rating.php",
beforeSend: function(jqXHR, settings){
$('#ratin').html('<p>Loading....</p>');
},
data:'r=' + r + '&id=' + id,
success: function(html) {
$("#"+(id)).html(html);
},
complete: function(html) {
setTimeout(done, 1000)
}
}
);
}
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.