0
當前的css不適用於光標設置。它只會在我設置時運作cursor css只能處理div名稱而不能處理div中的特定元素
光標:不允許;
添加到.bar類而不是像.bar p這樣的特定元素。我的目標是,在頁面上逐漸點擊時,.bar p光標會被設置爲指針和點事件,因爲元素可以點擊。這部分工作,但我希望在開始時所有的p元素都不允許作爲遊標設置。
<div class="bar">
<p id="income" onclick="redo(0, this.id)" >Income</p>
<p id="state" onclick="redo(1,this.id)">State</p>
<p id="rent" onclick="redo(2,this.id)">Rent</p>
<p id="zip" onclick="redo(3,this.id)">Zip Code</p>
<p id="roommate" onclick="redo(4,this.id)">Room mate</p>
</div>
.bar {
position: absolute;
height: 20px;
bottom: 70px;
margin: auto;
width: 70%;
margin-left: 15%;
color: green;
}
.bar p{
display: inline;
background-color: transparent;
color: green;
font-size: 16px;
padding: 10px;
margin: 0px auto;
text-align: center;
min-width: 50px;
border: 1px solid green;
z-index: 3;
-webkit-transition: 1s;
transition: 1s;
pointer-events: none;
cursor: not-allowed;
}
這些解釋了爲什麼光標不允許不會顯示不允許,因爲一切都設置爲無。我怎樣才能得到它,所以這些元素不會被點擊,直到我讓他們,但也有不允許的光標 – Aaron
@Aaron在這裏你去解決方案https://jsfiddle.net/3vvLrp75/3/。沒有'pointer-events:none;'。您需要解除綁定,然後再綁定到下一個'p'標籤。 – Shiladitya
@Aaron它幫助你了嗎? – Shiladitya