0
我有這個嵌套的自引導手風琴,其中摺疊完成by setting the element href's as "#collapseOne", "#collapseTwo"等等。修改鏈接並將其拖動到書籤工具欄
在我的頁面,當用戶點擊手風琴的鏈接頁面還加載由錨「data-guid
」屬性,如指定的內容:
//HTML
<a href="#collapseOne" data-guid="Cats">Click to fill page with cats</a>
$(".link_to_click").on("click", function(){
var guid = $(this).data("guid") // cats
loadContent(guid) // loads cats to page
});
我要收藏此頁拖動鏈接到書籤工具欄(火狐),我得到這個
當我喜歡的位置是www.catsforall.com/index.html?guid=cats
如果我嘗試開始拖動
$(".link_to_click").on("dragstart", function(){
$(this).prop("href", "www.catsforall.com/index.html?guid="+$(this).data("guid"));
});
它仍然爲書籤時改變HREF的原HREF即使它改變了HREF中的元素和dragend事件還表示,它已經改變。
$(".link_to_click").on("dragend", function(){
console.log($(this).prop("href")); // www.catsforall.com/index.html?guid=cats
});
我也一直在努力改變「路徑名」 - 屬性,並試圖與event.originalEvent.dataTransfer亂動,沒有運氣的對象。有任何想法嗎?