我想找到一些信息如何使「共享」按鈕,如here。我發現有可能在按鈕上產生如此多的效果,但我不知道如何調用這種效果以及如何實現。如果您有關於此按鈕效果的任何信息,將非常感激。jQuery動畫的按鈕
-2
A
回答
0
非常簡單的方法演示:https://jsfiddle.net/1ccyn/gyu2s2ae/
$("#left").mouseover(function(){
$(this).animate({width:'100%'});
$("#right").animate({width:'0%'});
})
$("#right").mouseover(function(){
$(this).animate({width:'100%'});
$("#left").animate({width:'0%'});
})
$("#left").mouseleave(function(){
$(this).animate({width:'50%'});
$("#right").animate({width:'50%'});
})
$("#right").mouseleave(function(){
$(this).animate({width:'50%'});
$("#left").animate({width:'50%'});
})
1
我也做從開發空上回答了一些變化,請參考:https://stackoverflow.com/a/8003361/5887755
演示:http://jsfiddle.net/yCY9y/1251/
$("#left, #right").each(function() {
$(this).data("standardWidth", $(this).width());
});
$("#left, #right").hover(function() {
$(this).stop(true, false).animate({
width: "100%"
}, 300);
$(this).parent().children().not(this).stop(true, false).animate({
width: "0%"
}, 300);
}, function() {
$(this).parent().children().each(function() {
$(this).stop(true, false).animate({
width: $(this).data("standardWidth")
}, 300);
});
});
更新:我沒放。 stop(true, false)
爲更好的結果。
相關問題
- 1. 動畫按鈕jQuery
- 2. 使用jquery動畫按鈕
- 3. 沒有顯示jQuery Mobile的按鈕「按下按鈕」動畫
- 4. 按鈕按動畫
- 5. jquery動畫按鈕問題的幫助?
- 6. jQuery的動畫切換按鈕
- 7. 動畫按鈕
- 8. Toogle動畫隱藏顯示按鈕jquery
- 9. JQuery滑出面板按鈕動畫
- 10. 動畫jQuery和css滑塊按鈕
- 11. 無法動畫jQuery Mobile按鈕元素
- 12. CSS - 動畫按鈕
- 13. 動畫按鈕HTML
- 14. 動畫按鈕Android
- 15. 按鈕動畫WPF
- 16. Tkinter按鈕動畫
- 17. PyQt5按鈕動畫
- 18. Qt動畫按鈕
- 19. 按鈕不動畫
- 20. Jquery旋鈕動畫
- 21. 奇怪的按鈕動畫
- 22. AS3的動畫按鈕
- 23. 滾動畫廊的按鈕
- 24. iOS中的動畫按鈕
- 25. android中的按鈕動畫
- 26. tableViewCell中的動畫按鈕
- 27. Android:按鈕移動動畫
- 28. 動畫按鈕運動
- 29. 動畫和主動按鈕
- 30. 脈動按鈕動畫android