/* 评论 */ $(function() { if($(".form_comment").length>0){ $(".form_comment").validator({ stoponerror: true, theme: 'yellow_top', ignore: ':hidden', valid: function(form) { $.fn.tips({ type: 'loading', content: '数据提交中' }); $.ajax({ url: webroot + "plug/comment.asp?act=add&id=" + infoid, type: "post", data: $(form).serialize(), success: function(data) { data = jquery.parsejson(data); var type = "warn"; if (data.status == "y") { type = "ok" } $.fn.tips({ type: type, content: data.info }); if (data.status == "y") { $(".form_comment")[0].reset(); var act = data.info.substring(0, 1); var info = data.info.substring(1); $.fn.tips({ type: "ok", content: info }); if (act == 2) { settimeout(function() { location.href = '' + contenturl + '' }, 1500) } } } }) } }) } }); /* 更多加载 */ var starthref; $(function() { if($(".c-moreajax a").length>0){ $(".c-moreajax a").click(function() { var href = $(this).attr("href"); starthref = href; if (href != undefined) { $.ajax({ type: "get", cache: false, url: starthref, success: function(data) { var $result = $(data).find(".c-ajax"); $(".c-commentajax").append($result); var newhref = $(data).find(".c-moreajax a").attr("href"); if (newhref != "") { $(".c-moreajax a").attr("href", newhref) } else { $(".c-moreajax").html('') } } }) } return false }) } }); /* 图片滚动放大 */ $(function() { if($("#c-imagemenu").length>0){ var count = $("#c-imagemenu li").length - 4; var interval = $("#c-imagemenu li:first").width(); var curindex = 0; $('.c-scrollbutton').click(function() { if ($(this).hasclass('disabled')) return false; if ($(this).hasclass('c-smallimgup'))--curindex; else++curindex; $('.c-scrollbutton').removeclass('disabled'); if (curindex == 0) $('.c-smallimgup').addclass('disabled'); if (curindex == count - 1) $('.c-smallimgdown').addclass('disabled'); $("#c-imagemenu ul").stop(false, true).animate({ "marginleft": -curindex * interval + "px" }, 600) }); $.fn.decorateiframe = function(options) { if (!$.support.leadingwhitespace) { var opts = $.extend({}, $.fn.decorateiframe.defaults, options); $(this).each(function() { var $mythis = $(this); var diviframe = $("