开发者

anchor hash ignores other url parameters

I have footnotes in page as:

<a href="#footnote">footnote</a>.

however if current location of the page is

www.domain.com/?q=something, 

the resulting url of footnote is not www.domain.com/?q=something#footnote, but www.domain.com/#footnote

so is absolute url usage is the only solution for above, or there some techniques to 开发者_运维百科come over this?

thanks


I just tried that in Chrome and it worked fine. By default, a browser will assume it's a relative URL (unless the format indicates otherwise).


From what you're posting here, I hardly see how it can fail. If you provided some more info, maybe people can help.


But it will happen at IE.

You can try this

jQuery(document).ready(function($) {
    $body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body');
    $body.animate({scrollTop: jQuery('.youcalss').offset().top}, 1000);
})
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜