我想使第一個圈可以擴大一樣大的背景與按鈕的第二個圈,誰知道怎麼做?如何使按鈕擴大圈
Q
如何使按鈕擴大圈
-3
A
回答
1
好一個辦法做到這一點是使用Java腳本添加和刪除保存你的圈子屬性的類。 您可以創建一個CSS類,該類包含一組屬性,然後在單擊按鈕時由javascript調用該屬性。
.circle_b {
height: 200px;
width: 200px;
border-radius: 50%;
background: #ddd;
position: relative;
}
.circle_s {
height: 80px;
width: 80px;
border-radius: 50%;
background: #ddd;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
border: 0;
background: coral;
cursor: pointer;
transition: all 0.2s ease;
}
.sizePlus{
height: 200px;
width: 200px;
transition: all 0.2s ease;
}
button{
display: block;
position: absolute;
width: 200px;
height: 100px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<body>
<script type="text/javascript">
$(document).click(function (e) {
$el = $(e.target);
if ($el.hasClass('clickme')) {
$(".circle_s").toggleClass('sizePlus');
} else {
$(".circle_s").removeClass('sizePlus');
}
});
</script>
<div class="circle_b">
<button class="circle_s clickme">
CLICK ME
</button>
</div>
</body>
1
動畫按鈕的懸停
HTML
<div class="circle_b">
<button class="circle_s">
HOVER ME!
</button>
</div>
CSS
.circle_b {
height: 200px;
width: 200px;
border-radius: 50%;
background: #ddd;
position: relative;
}
.circle_s {
height: 80px;
width: 80px;
border-radius: 50%;
background: #ddd;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
border: 0;
background: coral;
cursor: pointer;
transition: all 0.2s ease;
}
.circle_s:hover {
height: 200px;
width: 200px;
transition: all 0.2s ease;
}
相關問題
- 1. 佈局擴大按鈕按
- 2. 按鈕一圈
- 3. Objective-C SpriteKit - 如何製作按鈕圈
- 4. 按鈕,如果佈局擴張過大
- 5. 擴大大屏幕按鈕的佈局?
- 6. Xamarin圈圖像按鈕
- 7. 如何使相同大小的按鈕
- 8. 如何使twitter引導按鈕更大?
- 9. 如何使用按鈕放大QgraphicsView?
- 10. 按鈕在點擊時擴展大小
- 11. 如何放大Twitter按鈕?
- 12. 使按鈕大200%
- 13. 擴展按鈕
- 14. Android的觸摸事件圈擴大
- 15. iPhone Quartz2D呈現擴大圈子
- 16. 如何擴大這個圈子來填充轉換屏幕?
- 17. 如何擴展按鈕的樣式?
- 18. 如何擴展按鈕觸摸區域?
- 19. 如何使按鈕
- 20. 如何使div擴大
- 21. 類擴展按鈕
- 22. d3樹 - 如何在圓圈上添加按鈕/模板?
- 23. 如何在iPhone上點擊「方塊」和「圓圈」按鈕?
- 24. 如何僅允許點擊浮動動作按鈕的圈內?
- 25. 如何實現一個圓圈按鈕XAML
- 26. 使單選按鈕變大?
- 27. 設置按鈕textSize儘可能大,而不擴大android
- 28. 帶x按鈕的紅色圓圈?
- 29. Android按鈕畫圓圈效果
- 30. 多個按鈕到一個圓圈
,這和谷歌搜索中使用的backgroundColor或圓角半徑,嘗試一些代碼,你的自我。 –
我很害怕。什麼語言/平臺?沒有標籤,標題中沒有任何內容。你在這裏沒有給任何東西 – Madivad
@Madivad在問題中有標籤,不需要把它們放在標題中。儘管這樣做很少,但*是真實的。 – justinw