سؤال

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