Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
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 - Fatal编程技术网

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");
        }
    });
 });