我試圖創建一個內部跳線鏈接的頁面在同一頁面中跳轉到特定的錨標籤或標題標籤..如何創建浮動內部鏈接容器
我想要的跳線連接到固定在頂部,它是由滾動,並與當它到達頁腳頁腳滾動..
,我想滾動到無刷新爲我點擊任何的快速鏈接的頁面的特定鏈接..
我也想突出顯示當前正在滾動的鏈接..
我試圖做到這一點,但這裏是我想出了..
function goToByScroll(hash) {
$(document.body).animate({
'scrollTop': $(hash).offset().top
}, 500);
}
var $links = $('#links');
var $content = $('#content');
height = $(window).height();
$(window).scroll(function(){
if ($(window).scrollTop() >= height){
$links.css({ position:'fixed', top:'70px'});
$content.css({ marginLeft: '80px'});
} else {
$links.css({ position:'relative'});
$content.css({ marginLeft: '9px'});
}
});
// http://jsfiddle.net/MfS3J/13/
基本上我想創建這樣的 galaxy s4 review - the verge
亞..這將解決我的問題..感謝名單.. – 2013-05-05 07:31:47