'; if (replyuser) { html += '回复 ' + replyuser + ''; } html += ': ' + content + '' + ''; } else { var html = '
'; if (replyuser) { html += '回复 ' + replyuser + ''; } html += ': ' + content + '' + '
'; } //举报 $(".base-footer").show(); $('#com_' + tid).show(); $('#com_' + tid).append(html); var a = $('#replynum_' + tid).html(); var b = parseInt(a) + 1; $('#replynum_' + tid).html(b); $('#recon').fadeOut(); $(".flash").fadeIn(); } $('#retid').val(''); $('#regame').val(''); $('#replyuid').val(''); $('#replyuser').val(''); $('#recontent').val(''); $('#aid').val(''); $('#reobj').html('回复评论'); $('#lessnum_n').html(150); restop = true; }) } else { alert('请输入内容'); restop = true; } $('#reobj').html('回复评论'); // myScroll.refresh(); } }); $('#recancel').click(function () { $(".base-footer").show(); $('#retid').val(''); $('#regame').val(''); $('#replyuid').val(''); $('#replyuser').val(''); $('#aid').val(''); $('#recontent').val(''); $('#reobj').html('回复评论'); $('#recon').hide(); $('#lessnum_n').html(150); $(".flash").fadeIn(); }); //加载判断 by yaosy var range = 70; //距下边界长度/单位px stop = true; var totalheight = 0; var num = 1; var is_mobile = ""; if (!is_mobile) { $('#container').scroll(function () { var srollPos = $('#container').scrollTop(); //滚动条距顶部距离(页面超出窗口的高度) totalheight = parseFloat($(window).height()) + parseFloat(srollPos); if ($('#d-talk').height() - range <= totalheight) { if (stop == true) { stop = false; num++; $('#climore').hide(); $('#load_l').show(); setTimeout("load()", 1000); } } }); } $("#code_show").mouseover(function () { var get_url = $('#get_url').val(); $('#code_show_src').attr('src', get_url); $('#pshow').show(); }); $("#code_show").mouseout(function () { $('#pshow').hide(); }); // lenth(); }); //点击加载 by yaosy function climore() { if (stop == true) { stop = false; $('#climore').hide(); $('#load_l').show(); setTimeout("load()", 1000); } } var page = "1"; if (page == "") page = 0; function load() { page = parseInt(page) + 1; $.ajax({ url: '/community.php', data: { game: '', page: page, action: 'more' }, dataType: 'json', success: function (msg) { if (msg == null) { $('#load_l').hide(); $('#nonemsg').show(); return false; } console.log(msg); var result = setHtml(msg); $("#tclick").before(result); if (msg.length < 10 || page >= 30) { $('#load_l').hide(); $('#nonemsg').show(); } else { stop = true; $('#climore').show(); $('#load_l').hide(); } }, complete: function (msg) { $(".swipebox").swipebox(); myScroll.refresh(); } }) } //编辑加载html代码 by yaosy function setHtml(data) { var str = ''; for (var i in data) { //console.log(data[i]['content']); var useragent = navigator.userAgent; // var patt= new RegExp("appleappclient",useragent.toLowerCase()); var patt1 = /appleappclient/gi; var patt = useragent.toLowerCase().match(patt1); // console.log(patt); str += '
'; if (patt == '123appleappclient') { str += ''; } else { str += ''; } str += '
'; str += '
'; if (patt == '123appleappclient') { str += '' + data[i]['author'] + ''; } else { str += '' + data[i]['author'] + ''; } str += '' + data[i]['info']['vip_lv'] + '
'; if (data[i]['only_cus'] == 1) { str += '仅客服看到'; } str += '
'; if (data[i]['if_overflow']) { str += '全部显示 '; } str += '
'; for (var j in data[i]['picture']) { str += ''; } str += '
'; if ('' == '') { gameurl = 'h.zixia.com/game-' + data[i]['gamejp']; str += '
'; if (patt == '123appleappclient') { str += '
' + data[i]['gamename'] + '
'; } else { str += '' + data[i]['gamename'] + '
开始游戏
'; } str += '
'; } str += '
' + data[i]['postdate'] + '