开发者

Hyperlinks delayed in working?

This page is using jQuery to modify the links and then perform the page slide.

If you click on the 'Next' button a couple of times, then try to click the 'Prev' button, it doe开发者_运维知识库s not do anything until you click the 'Prev' button around 3 times.

Can anyone suggest a reason why and how to make it instant?


The problem here is you're changing the href in the click event, if you want to navigate to these, you need to change it in something earlier, say mousedown, like this:

$(function () {
    $.localScroll.defaults.axis = 'x';
    $.localScroll({offset:-250});

    var LinkCounter = 0;
    $('#prev').mousedown(function(){    
        PrevCounter = LinkCounter--;
        this.href='#box' + LinkCounter;
        $('#next').attr({href: '#box' + PrevCounter});        
    });
    $('#next').mousedown(function(){    
        PrevCounter = LinkCounter++;
        this.href='#box' + LinkCounter;
        $('#prev').attr({href: '#box' + PrevCounter});                

    });
});

You can test it out here - or test a full screen version here.


have you tried changing jquery version to latest to match other jquery elements.

is the cufon affecting the links ?


I'm not especially familiar with the ScrollTo plugin, but have you tried modifying the click functions to return false at the end?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜