$(function () { //--------------模拟单选 $(document).on("click", ".label-radio", function () { $(this).addClass("on").siblings().removeClass("on"); }); $(".label-radio").each(function () { if ($(this).find("input").prop("checked")) { $(this).addClass("on") } }) //end //--------------模拟多选 // $(".label-checkbox").click(function (e) { // console.log($(this)) // e.stopPropagation(); // if ($(this).hasClass("on")) { // $(this).removeClass("on") // } else { // $(this).addClass("on") // } // }); $(document).on("change", ".label-checkbox input", function () { if ($(this).prop("checked")) { $(this).parent().addClass("on") } else { $(this).parent().removeClass("on") } }); $(".label-checkbox").each(function () { if ($(this).find("input").prop("checked")) { $(this).addClass("on") } }); //end $(document).on("click",".select_box span",function(e){ $(this).parent().siblings().find("dl").hide() e.stopPropagation() if($(this).next().is(":hidden")){ $(this).next().show(); }else{ $(this).next().hide(); } }) $(document).on("click",".select_box dl dd a",function(e){ e.stopPropagation() $(this).parent().parent().hide(); $(this).parent().parent().siblings().html($(this).html()) }) $(document).click(function(){ $(".select_box span").next().hide(); }) }) //--------------ajax下拉页面无限加载 function ajax_con(){ var $resourceTypeList = $('.list'); $resourceTypeList.infinitescroll({ navSelector: "#more", nextSelector: "#more a", itemSelector: ".panel", clickb: true, clickobj: ".load-more-link", loading: { img: "../images/loading.gif", msgText: ' ', finishedMsg: '没有了', finished: function () { $("#infscr-loading").hide(); } }, errorCallback: function () { $(".load-more-link").after("
没有了
"); $(".load-more-link").hide(); setTimeout(function () { $(".finMessage").fadeOut(); }, 500) } }, function (newElements) { var $newElems = $(newElements); $newElems.fadeIn(); return; }); }