/// // function imgratio() {//ͼƬ ratio�������� // var winw=$(window).width(); // $("img.ratio-img,div.ratio-img").each(function (index, element) { // var $this = $(this), // seth= Math.floor($this.width() * $this.data("ratio")) // $this.css({ height: seth }); // //banner图高度设置 // if($this.parents(".swiper-wrapper").length>0){ // $this.parents(".swiper-wrapper").height(seth) // $this.parents(".swiper-slide").height(seth) // } // }); // } // $(function () { // imgratio()//��ʼ��ͼƬratio // setTimeout(function () { // imgratio(); // }, 200) // //���ڸı��С�ص�ratio�� // var rtime = new Date(); // var timeout = false; // var delta = 200; // $(window).resize(function () { // rtime = new Date(); // if (timeout === false) { // timeout = true; // setTimeout(resizeend, delta); //resizeֻ�ص����һ�� // } // }); // function resizeend() { //window.resize�ص� // if (new Date() - rtime < delta) { // setTimeout(resizeend, delta); // } else { // timeout = false; // imgratio()//ratio // } // } // // // }) //暂无图片 var nullimg = '../images/null.gif'; function lod(t) { t.onerror = null; t.src = nullimg $(t).addClass("null") } $(function () { $(".ratio-img").each(function () { if ($(this).attr("src") == "") { $(this).attr({ "src": nullimg }).addClass("null") } }) })