JQuery高度条件 $(文档).ready(函数(){ var pic=$(“.pic”); //如果img元素设置了宽度和高度,则需要移除这些 $(“.pic”)。每个(函数(){ var$this=$(this); $this.css({width:'auto',height:'auto'}); var pic_real_width=$this.width(); var pic_real_height=$this.height(); 如果(pic_real_width
这应该可以做到:JQuery高度条件 $(文档).ready(函数(){ var pic=$(“.pic”); //如果img元素设置了宽度和高度,则需要移除这些 $(“.pic”)。每个(函数(){ var$this=$(this); $this.css({width:'auto',height:'auto'}); var pic_real_width=$this.width(); var pic_real_height=$this.height(); 如果(pic_real_width,jquery,css,height,width,Jquery,Css,Height,Width,这应该可以做到: $(document).ready(function() { var pic = $(".pic"); // need to remove these in of case img-element has set width and height $(".pic").each(function() { var $this = $(this); $this.css({width: 'auto', height: 'auto'}); var pic_re
$(document).ready(function() {
var pic = $(".pic");
// need to remove these in of case img-element has set width and height
$(".pic").each(function() {
var $this = $(this);
$this.css({width: 'auto', height: 'auto'});
var pic_real_width = $this.width();
var pic_real_height = $this.height();
if(pic_real_width<100){
$(".pic").css("display","none");
}
});
});
$(文档).ready(函数(){
//如果img元素设置了宽度和高度,则需要移除这些
$(“.pic”)。每个(函数(){
var$this=$(this);
$this.css({width:'auto',height:'auto'});
var pic_real_width=$this.width();
var pic_real_height=$this.height();
if(pic_real_)你不是在5分钟前问过同样的问题吗?其实很相似,这是指代码的if。
$(document).ready(function() {
// need to remove these in of case img-element has set width and height
$(".pic").each(function() {
var $this = $(this);
$this.css({width: 'auto', height: 'auto'});
var pic_real_width = $this.width();
var pic_real_height = $this.height();
if(pic_real_width<100){
$this.css("display","none");
}
});
});