var Myui = { 'Score':function(){ var hadpingfen = 0; $("ul.rating li").each(function(i) { var $title = $(this).attr("title"); var $lis = $("ul.rating li"); var num = $(this).index(); var n = num + 1; $(this).click(function () { if (hadpingfen > 0) { layer.msg('已经评分,请务重复评分'); } else { $lis.removeClass("active"); $("ul.rating li:lt(" + n + ")").find(".fa").addClass("fa-star").removeClass("fa-star-o"); $("#ratewords").html($title); var score = $(this).attr("val"); var nocache = new Date().getTime(); MyTheme.Ajax("/include/ajax.php?id="+$('#rating').attr('data-id')+"&action=score&score="+score+"×tamp="+nocache,'get','text','',function(r){ if((''+r.responseText).indexOf("havescore")!=-1){ layer.msg("您已经评过分啦"); hadpingfen = 1; } else { hadpingfen = 1; layer.msg("感谢参与!"); } }); } } ).hover(function () { this.myTitle = this.title; this.title = ""; $(this).nextAll().find(".fa").addClass("fa-star-o").removeClass("fa-star"); $(this).prevAll().find(".fa").addClass("fa-star").removeClass("fa-star-o"); $(this).find(".fa").addClass("fa-star").removeClass("fa-star-o"); $("#ratewords").html($title); }, function () { this.title = this.myTitle; $("ul.rating li:lt(" + n + ")").removeClass("hover"); }); }); }, 'Autocomplete': function() { $('#wd').keyup(function(){ var keywords = $(this).val(); if (keywords=='') { $('#word').hide(); return }; $.ajax({ url: '/ass.php?wd=' + keywords, dataType: 'jsonp', jsonp: 'cb', beforeSend:function(){ $('.wordlist').append('