我使用JS作为更改我正在创建的SPA的内容的一种方式.当我按下按钮更改内容时,HTML将从以下位置更改:
<div id="selectDiv" style="display: none;">
对此,请执行以下操作:
<div id="selectDiv" style>
Now part of my SPA has a div that contains a number of checkboxes, each representing a div, and so when I press the submit button, the next div that should be displayed will be the first item in the checkbox list that was selected.
I'm wondering if there's a way in JQuery for the code to "almost detect" which div is now visible. something like this:
if($('#selectDiv').isVisible()){
//JS code associated with this div.
}
有什么建议吗?