Вопрос

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';
        }
});
Это было полезно?

Решение 2

I solved it, this is my solution:

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

Thanks for your help!

Другие советы

it should be like

if(hash == ''){
    hash = '#home';
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top