1、 $('#addinfo').hide();
addinfo 根据条件不同 hide()
或 show()
;
2、
if (($("#addinfo").css('display')) === 'none') {
alert("被你发现了,我是隐藏的啦!");
$(el).css({
"width":360,
"position":"fixed",
"left":"50%",
"top":"50%",
"z-index":9999
}).css({
"margin-left":-parseFloat($(el).outerWidth())/2,
"margin-top":-parseFloat($(el).outerHeight())/2,
"display":'none'
});
} else {
$(el).css({
"width":780,
"position":"fixed",
"left":"50%",
"top":"60%",
"z-index":9999
}).css({
"margin-left":-parseFloat($(el).outerWidth())/2,
"margin-top":-parseFloat($(el).outerHeight())/2,
"display":'none'
});
}
3、
$(document).on('click',"#ordinaryuser",function () {
/* $('#addinfo').hide();*/
$('#addinfo').css({'display':'none'});
$('#isstudent').val(0);
$('#ordinaryuser').hide();
$('#studentuser').show();
});
4、if (($("#addinfo").css('display'))=== 'none')
这样没效果,求解?
$('#addinfo').css('display')==='none'
上面这段代码是可以判断元素是够隐藏的