$('.mask').click(function() { $('.mask').fadeOut(); }); $(".btn-btt").click(function() { $("html, body").animate({ scrollTop: 0 }, "slow"); }); $("#btn_report_cancel").click(function(e) { $(".mask").fadeOut(); $('.report-popup').fadeOut(); }); $(".btn-comment").click(function() { $("div.btn-comment").hide(); $('.comment').show(); $("html, body").animate({ scrollTop: $('.comment').offset().top }, 500); }); $(".switch-view li").click(function() { $(".switch-view li").removeClass('selected'); $(this).addClass('selected'); $(".switch-block").attr('class', 'switch-block ' + $(this).attr('data-view')); }); $(".lazy").lazyload({ effect: "fadeIn", failure_limit: 10, skip_invisible: true }); $(".show-all").click(function() { $(this).remove(); $(".all-episode li").fadeIn().css("display", "inline-block"); }); $(".tab li").click(function() { var tab_class = $(this).attr('data-tab'); $('.' + tab_class).parent().find('.tab-content').removeClass('selected'); $('.' + tab_class).addClass('selected'); $(window).trigger('scroll'); }); //navbar var current_url = window.location.protocol + '//' + window.location.hostname + window.location.pathname; $(".navbar li>a").each(function() { if (this.href === current_url) { $(this).parent().addClass('selected'); } }); if ($(".topview")) { loadTopViews(1) } function loadTopViews(id) { if (id > 1) { $("#loading").show(); } if ($.trim($(".load_topviews.views" + id).html()).length > 0) { $("#loading").hide(); } $(".tab_icon").removeClass("active"); $(".movies_show .load_topviews").hide(); $(".tab_icon.one" + id).addClass('active'); $(".load_topviews.views" + id).show(); if (id > 0) { $(".load_topviews.views" + id).is(":empty") && $.ajax({ url: '/api?a=topviews&id=' + id, type: 'GET', async: true, crossDomain: true, success: function(data) { if (data == '') return; $(".load_topviews.views" + id).html('