Я хочу, чтобы выполнить 3 функции в определенном порядке, и я делаю это:Выполнение функций в порядке
function nextPage() {
var loading_temp = $('#loading_temp');
loading_temp.show()
.queue(function() {
nextPage980()
.queue(function() {
loading_temp.hide();
$(this).dequeue();
});
$(this).dequeue();
});
}
«#loading_temp» показывает вверх, а затем функция выполняется, но последняя функция (скрыть загрузку gif) не выполняется!
Chrome дает эту ошибку: неперехваченным TypeError: Невозможно вызвать метод 'очереди' неопределенной
The nextPage980() функция заключается в следующем:
function nextPage980() {
var ajax_heading = $('#ajax_heading');
var cur_heading = $('#cur_heading');
var temp_heading = $('.temp_heading');
var temp_heading_first = temp_heading.filter(':first');
var loading_temp = $('#loading_temp');
var htmlHeader = "Εγκαταστάσεις";
ajax_heading.attr('class', 'next_temp');
cur_heading.css({'margin-right' : '20px'}).after('<div id="cur_heading" class="temp_heading" data-tempPos="2"><h1 class="page_heading"><span class="heading_span">' + htmlHeader + '</span></h1></div>')
.queue(function() {
ajax_heading.animate({'margin-left' : '-1000px'}, 1000, 'easeInExpo')
.queue(function() {
temp_heading_first.remove();
cur_heading.removeAttr('style');
ajax_heading.attr('class', 'cur_temp').removeAttr('style');
$(this).dequeue();
});
$(this).dequeue();
});
}
Заранее спасибо!
Если вы ничего не возвращаете, это 'undefined'. Так что все работает нормально. – noob