我正在学习 jQuery 和 java 脚本,目前我在显示隐藏按钮时遇到问题,我的 html 是
<span style="float:left;padding-right:10px">
<input type="button" value="image" class="delete" />
<a href="/media/image"><img src="/media/image" /></a>
</span>
<span style="float: left; padding-top: 5px;">
<a href="/media/image">
<button type="submit" class="delete_media">Delete</button>
</a>
</span>
J查询:
$(".delete").click(function(){
var $this = $(this);
$this.siblings(".delete_media").toggle();
});
CSS:
.delete_media {
display:none;
float: right;
height: 25px;
width: 60px;
-moz-border-radius: 10px;
border-radius:10px;
}
我也尝试过使用 find、nextAll、closest 也没有任何效果,所以如何让它工作。
演示 Here
最佳答案
关于javascript - 从跨度到跨度遍历按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18652427/