ltt.js
var dailyBox = $(‘.daily-box-office‘), curDate = new Date(), curYear = curDate.getFullYear(), curMonth = curDate.getMonth()+1; dailyBox.find(‘.month‘).text(‘(‘+curMonth+‘月)‘); try{ $.ajax({ url : "http://ltt.1905.com/rank/getranklist", dataType : "jsonp", jsonpCallback : "getranklist", cache : false, success : function(data){ dailyBox.find(‘.box-office-week‘).html(data.boxoffice_week); dailyBox.find(‘.box-office-total‘).html(data.boxoffice_all); var arroffice = [], arrday = []; for (var i = 0; i < data.boxoffice.length; i++) { arroffice[i]=data.boxoffice[i]; }; for (var i = 0; i < data.date_day.length; i++) { arrday[i]=data.date_day[i]; }; dailyBox.find(‘div.deadline‘).append(‘(截止<span class="deadline">‘+data.date+‘</span>)‘); $(‘#highcharts‘).highcharts({ chart: { type: ‘line‘, width: 280, height: 192, backgroundColor: ‘rgba(0,0,0,0)‘ }, credits:{ enabled:false }, title: { text: ‘‘ }, xAxis: { categories: arrday, lineWidth :0, tickWidth:0 }, yAxis: { title: { text: ‘‘ }, labels: { enabled: false }, gridLineWidth:0 }, plotOptions: { line: { dataLabels: { enabled: true }, enableMouseTracking: true } }, series: [{ name: ‘狼图腾‘, data: arroffice, color: ‘#ffa567‘ }], legend: { enabled: false }, tooltip: { shared: true, //是否共享提示,也就是X一样的所有点都显示出来 useHTML: true, //是否使用HTML编辑提示信息 headerFormat: ‘‘, pointFormat: ‘<tr><td style="color: {series.color}"> </td>‘ + ‘<td style="text-align: right"><b>{point.y}</b></td></tr>‘, footerFormat: ‘</table>‘, backgroundColor: ‘#fda364‘, style: { //提示框内容的样式 color: ‘white‘, fontSize: ‘15px‘ }, valueDecimals: 0 //数据值保留小数位数 } }); }//success end }) }catch(error){ alert(error.message); } function countdown(){ var countdown = $(".header .time"), reduceDay = countdown.children(".countdown"), seed = 0, startTime = (+new Date(2015,1,13,18,0,0,0)) / 1000; function numFormat(num){ if(num < 10){ return "0" + num; }else{ return num; } } function timeEnd(){ reduceDay.text("00"); } function setRemainTime(time){ time = time - seed; if (time > 0) { var day = Math.floor((time / 3600) / 24); reduceDay.text(numFormat(day)); } else { timeEnd(); } seed++; } function ajaxHandle(xhr){ var headers = xhr.getResponseHeader(‘Date‘), tmp = Date.parse(headers) / 1000, reduce = startTime - tmp; if(reduce > 0) { countdown.attr(‘diff‘,‘‘); countdown.attr(‘diff‘, reduce); var time = parseInt(countdown.attr(‘diff‘)); setRemainTime(time); var InterValObj = window.setInterval(function(){setRemainTime(time)},1000); } else{ timeEnd(); } } $.ajax({ type : "get", url : "http://ltt.1905.com/time.html", cache : false, success : function(data,status,xhr){ ajaxHandle(xhr); }, error : function(xhr){ ajaxHandle(xhr); } }); } countdown(); function Scroll(context, speed, or, width, height) { var context = $(context); var wrapper = context.find(‘.scroll-wrapper‘); var prev = context.find(‘.previous-button‘); var next = context.find(‘.next-button‘); var img = context.find(‘.scroll-items‘); var w = img.find(‘li‘).outerWidth(true); var s = speed; wrapper.add(context).css({"width":width,"height":height}); next.click(function () { img.stop(true, true).animate({ ‘margin-left‘: -w }, function () { img.find(‘li‘).eq(0).appendTo(img); img.css({ ‘margin-left‘: 0 }); }); }); prev.click(function () { img.find(‘li:last‘).prependTo(img); img.css({ ‘margin-left‘: -w }); img.stop(true, true).animate({ ‘margin-left‘: 0 }); }); if (or == true) { var ad = setInterval(function () { next.click(); }, s * 500); wrapper.add(prev).add(next).hover(function () { clearInterval(ad); }, function () { ad = setInterval(function () { next.click(); }, s * 500); }); } } var innerlen = $(‘.innerBox‘).length, wrapWidth = innerlen * 920, tab = $(‘.role-tab-pic‘); $(‘.wrapBox‘).width(wrapWidth); tab.click(function(){ var nIndex = $(this).index(); $(this).addClass(‘on‘).siblings(‘li‘).removeClass(‘on‘); $(‘.wrapBox‘).animate({‘left‘:-(920*nIndex)+‘px‘},100); }) $(window).bind(‘scroll‘,function(){ var windowHeight = $(‘.header‘).height(); var scrollHeight = document.documentElement.scrollTop||document.body.scrollTop; if(scrollHeight > windowHeight){ $(‘.nav-fixed‘).show(); }else{ $(‘.nav-fixed‘).hide(); } }) $(‘.code‘).hover(function(){ $(this).find(‘.show‘).show(); },function(){ $(‘.show‘).hide(); }) $(‘.scrolltop‘).click(function(){ $(‘html,body‘).animate({scrollTop:0}); }) var filmTitle = mdbFilmData.title, filmId = mdbFilmData.filmid; var refer = $(‘.rating-act‘).data(‘refer‘) == null ? "" : $(‘.rating-act‘).data(‘refer‘); mBuffer(‘http://js.static.m1905.cn/core/ui.min.js‘,‘http://static.m1905.com/assets/t4/js/jquery.raty.min.js‘,function(){ var options = { path: ‘http://static.m1905.com/assets/ltt/images/‘, half: true, hints: [‘很差‘, ‘较差‘, ‘一般‘, ‘不错‘, ‘力荐‘], target: ‘.hint‘, targetKeep: true, readOnly: filmStatus.scorestart == 0, click: function(score, event) { $.Zebra_Dialog(‘确认提交评分?‘, { ‘title‘: ‘电影网提示:‘, ‘buttons‘: [ {caption: ‘确认‘, callback: function() { $(".star-raty").raty("readOnly", true); console.log(‘refer: ‘+refer); var auth = M1905.Util.getcookie("uid") == null ? "" : M1905.Util.getcookie("uid"); switch (i) { case i: i = 44 + i * 2; break; default: i = 54; break } $.ajax({ url: "http://interact.1905.com/Ajax/interact/", dataType: "jsonp", data: { "contentid": filmId, "appid": "DYWZZ", "objid": "1", "aspectid": "1", "rangeid": i, "uid": auth, "refer":refer }, jsonp: "callback", success: function (data) { if (data.status == 200) { $("#rating_num").text(parseInt($("#rating_num").text()) + 1); $("#total_noawait").trigger("click"); }; if (data.status == 307) {} else { if (data.status == 308) {} } return false }, error: function () { return false } }) } }, {caption: ‘取消‘ } ] }); } } $(‘.star-raty‘).raty(options); }) var url = "http://interact.1905.com/Ajax/getContentScore/?contentid=" + filmId + "&appid=DYWZZ&objid=1&aspectid=12"; $.ajax({ url : url, dataType : "jsonp", async: false, jsonpCallback : "count_tosee", cache : true, success : function(data){ if(data.status == 200){ var msg = data.msg,msgData,all,hsee,tsee; if(msg instanceof Array){ hsee = 0; tsee = 0; } else{ msgData = data.msg[filmId], all = msgData.num, hsee = msgData.score, tsee = all - hsee; } $("#show_noawait").html(hsee); $("#show_isawait").html(tsee); getNum(); } } }); var url_score_script_new = "http://www.1905.com/pubfunc/score_rating_20110624.php"; function movie_ajax_await_new(id, doawait) { if(typeof(id) != "number" || typeof(doawait) != "string") return false; var rid = (doawait == ‘isawait‘)?68:67; var snow = $(‘#show_‘+doawait).html(); snow = parseInt(snow) + 1; $(‘#show_‘+doawait).html(‘‘); $(‘#show_‘+doawait).html(snow); var postData = {"contentid": id,"appid": "DYWZZ","objid": "1","aspectid": "12","rangeid":rid,"refer":refer}; var url = "http://interact.1905.com/Ajax/interact/"; $.ajax({ url: url, data: postData, dataType: "jsonp", jsonp: "callback", success: function(data){ if(data.status==200){ if (doawait == ‘isawait‘) { $(‘#total_isawait‘).attr(‘onclick‘,‘return false‘); $(‘.yesStarBIG‘).hide(); $(‘#SFx‘).attr("onclick",""); } else { $(‘#total_noawait‘).attr(‘onclick‘,‘return false‘); } alert(‘谢谢参与‘); return false; } } }); } function getNum(){ var operated = 0; $(‘.count .like-btn‘).one(‘click‘, function(){ if (operated) return; movie_ajax_await_new(parseInt(filmId),‘isawait‘); operated = 1; $(this).addClass(‘disable‘); $(‘.count .dislike-btn‘).unbind(‘click‘); }); $(‘.count .dislike-btn‘).one(‘click‘, function(){ if (operated) return; movie_ajax_await_new(parseInt(filmId),‘noawait‘); operated = 1; $(this).addClass(‘disable‘); $(‘.count .like-btn‘).unbind(‘click‘); }); }
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。