Question

I have a question about the jquery.hashchange.js.

I get everything to work, my only problem is when there is no hash. When you first go to the page, it just is: domain.com/

But it should act like: domain.com/#home

I tried this, but it wont work:

$(window).hashchange( function(){
        var hash = location.hash;

        if(hash = ''){
            hash == '#home';
        }
});
Était-ce utile?

La solution 2

I solved it, this is my solution:

if(hash == '#home' || hash == ""){

Thanks for your help!

Autres conseils

it should be like

if(hash == ''){
    hash = '#home';
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top