Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/441.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
如果图像大小javascript条件为ok,则显示div_Javascript_Jquery_Html_Css_Jquery Ui - Fatal编程技术网

如果图像大小javascript条件为ok,则显示div

如果图像大小javascript条件为ok,则显示div,javascript,jquery,html,css,jquery-ui,Javascript,Jquery,Html,Css,Jquery Ui,我需要一些帮助。我试图在javascript中设置一个条件,在对象调整大小并具有所需的宽度和高度后显示一个div 这是我的密码 HTML 所以我需要这样的东西 $('#image1').click(function(){ if $('#image1') have height 240 and width 107 show $('#image2') ); 但是我不知道怎么写这个条件。请帮帮我 当image1调整为高度240和宽度107时,是否有可能自动显示image2 谢谢 对不起,我的英语

我需要一些帮助。我试图在javascript中设置一个条件,在对象调整大小并具有所需的宽度和高度后显示一个div

这是我的密码

HTML

所以我需要这样的东西

$('#image1').click(function(){

if $('#image1') have height 240 and width 107
show $('#image2')

);
但是我不知道怎么写这个条件。请帮帮我

当image1调整为高度240和宽度107时,是否有可能自动显示image2

谢谢

对不起,我的英语不好

if($('#image1').width() == 107 && $('#image1').height() == 240){
  $('#image2').show()
}
如果要在调整事件大小时自动显示,请使用


条件是:

if ($('#image1').height() == 240 && $('#image1').width() == 107) { $('#image2').show(); } 如果($('#image1').height()==240&$('#image1').width()==107){ $('#image2').show(); } 希望对你有帮助

$('#image1').on('click',function(){

   if($('#image1').width() == 107 && $('#image1').height() == 240) {

      $('#image2').show()
   }

);
$( "#image1" ).resizable({ 
     maxHeight: 240 , 
     maxWidth : 107 , 
     minWidth: 107,
     resize: function (event, ui){
      if($('#image1').width() == 107 && $('#image1').height() == 240){
        $('#image2').show()
       }
    }
});
if ($('#image1').height() == 240 && $('#image1').width() == 107) { $('#image2').show(); }
$('#image1').on('click',function(){

   if($('#image1').width() == 107 && $('#image1').height() == 240) {

      $('#image2').show()
   }

);