我在我的網站上使用了smooth scrolling plugin進行導航,但它將#divname添加到URL末尾(www.mysite.com/#div)。我想知道我會如何刪除這個。使用jQuery刪除/#divname
謝謝。
我在我的網站上使用了smooth scrolling plugin進行導航,但它將#divname添加到URL末尾(www.mysite.com/#div)。我想知道我會如何刪除這個。使用jQuery刪除/#divname
謝謝。
在代碼中刪除location.hash = target;
($(scrollElem).animate
回調)。請注意,用戶將不再獲取添加到其歷史記錄的條目,這可能會或可能不會混淆用戶,具體取決於您的具體情況。
評論源以下行:
location.hash = target;
我以前沒使用這個插件,所以這是值得注意的,可能會影響其功能。
刪除以下行
location.hash = target;
它是如何工作的。爲什麼你想要刪除它? – 2011-04-08 11:29:10
這看起來像是一個功能,而不是bug ... – lonesomeday 2011-04-08 11:30:55
插件不能顯示'div'的'name'屬性,而不是使用'div'的'id'屬性 – 2011-04-08 11:32:36