Trying to get #home to display if there is no hash present in the url. I figured something along these lines would work pretty easy but I can't get anything going:
if(window.location.hash != null){
$(window.location.hash).fadeIn(800);
} else {
$('#home').fadeIn(800);
}
I've never worked with if / else statements in jquery, so this is obviously wrong
thanks!
Compare it against the empty string instead (null and the empty string aren't equal in JavaScript):
if(window.location.hash != ''){
$(window.location.hash).fadeIn(800);
} else {
$('#home').fadeIn(800);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With