如果图像大小javascript条件为ok,则显示div
我需要一些帮助。我试图在javascript中设置一个条件,在对象调整大小并具有所需的宽度和高度后显示一个div 这是我的密码 HTML 所以我需要这样的东西如果图像大小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 谢谢 对不起,我的英语
$('#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()
}
);