Jquery 单击“将图元移动到第一个位置”
我试图使其在单击时,该元素移动到“news-layout-1”元素中的第一个位置。到目前为止,我还没能让它工作。我尝试使用的实际脚本是一个RSS提要,因此我无法添加单个类名Jquery 单击“将图元移动到第一个位置”,jquery,Jquery,我试图使其在单击时,该元素移动到“news-layout-1”元素中的第一个位置。到目前为止,我还没能让它工作。我尝试使用的实际脚本是一个RSS提要,因此我无法添加单个类名 <div class="news-layout-1"> <div class="item-post"><h1 class="item-title">First One</h1></div> <div class="item-post"><h
<div class="news-layout-1">
<div class="item-post"><h1 class="item-title">First One</h1></div>
<div class="item-post"><h1 class="item-title">Second One</h1></div>
<div class="item-post"><h1 class="item-title">Third One</h1></div>
<div class="item-post"><h1 class="item-title">Fourth One</h1></div>
<div class="item-post"><h1 class="item-title">Fifth One</h1></div>
</div>
$(".item-post").click(function() {
$($this).prependTo($(".item-post:first-of-type"));
});
第一个
第二个
第三个
第四个
第五个
$(“.item post”)。单击(函数(){
$($this.prependTo($(“.item post:first of type”);
});
小提琴:试试这个:-
$(".item-post").click(function() {
$('.news-layout-1').prepend($(this));
});
试试这个:-
$(".item-post").click(function() {
$('.news-layout-1').prepend($(this));
});
试试这个:-
$(".item-post").click(function() {
$('.news-layout-1').prepend($(this));
});
试试这个:-
$(".item-post").click(function() {
$('.news-layout-1').prepend($(this));
});
你想要这个@Kartikeya是的。谢谢把它作为答案贴出来,我会接受。你想要这个@Kartikeya是的。谢谢把它作为答案贴出来,我会接受。你想要这个@Kartikeya是的。谢谢把它作为答案贴出来,我会接受。你想要这个@Kartikeya是的。谢谢把它作为答案贴出来,我会接受的。