$(".main-head").on("click", "#next", function(e) {
e.preventDefault();
var template = $("#slider").html();
var id = $(".main-head .id").data('id');
var countdown = $(this).find('a.count');
var cur_count = countdown.data("count");
var slides_count = $('.main-head').data('slides');
$.ajax({
type: "post",
url: "/gtc/next",
data: { "id":id },
beforeSend: function() {
$(".main-head .covered").hide("explode", {}, 1000);
},
success: function(item) {
$(".main-head").html(_.template(template,{ item:item }));
$(".main-head .covered").show("explode", {}, 1000);
$(".main-head").find('a.count')
.text(cur_count+1+"/"+slides_count)
.data('count', cur_count+1)
.attr('count', cur_count+1);
}
});
});
{
type: "post",
url: "/gtc/next",
data: { "id":id },
success: function(item) {
$(".main-head .covered").hide("explode", {}, 1000,function(){
$(".main-head").html(_.template(template,{ item:item }));
$(".main-head .covered").show("explode", {}, 1000);
$(".main-head").find('a.count')
.text(cur_count+1+"/"+slides_count)
.data('count', cur_count+1)
.attr('count', cur_count+1);
});
}
}
.hide("explode", {}, 1000);
$(".main-head").on("click", "#next", function(e) {
e.preventDefault();
var template = $("#slider").html(),
id = $(".main-head .id").data('id'),
countdown = $(this).find('a.count'),
cur_count = countdown.data("count"),
slides_count = $('.main-head').data('slides');
$(".main-head .covered").fadeOut(1000, function() {
$.post("/gtc/next", { id: id }, function(resp) {
$(".main-head").html(_.template(template, { item:resp }));
$(".main-head").find('a.count')
.text(cur_count+1+"/"+slides_count)
.data('count', cur_count+1)
.attr('count', cur_count+1);
$(".main-head .covered").fadeIn(1000);
});
});
});