So this mostly works, however, the only URL that works is what is specified as "Blog." All the anchor references with # are smooth scrolling on click but all my external links on my page aren't doing anything.
Can I write the prevent default in a way that only includes the href links with "#" in them? I have image links, etc throughout my page and want a simple method to manage it rather than pointing each url out.
<ul class="snip1143">
<li class><a href="#home1" data-hover="Home">Home</a></li>
<li><a href="#about1" data-hover="About">About</a></li>
<li><a href="#experience1" data-hover="Work">Work</a></li>
<li><a href="URL HERE" data-hover="Blog">Blog</a> </li
<li><a href="#contact1" data-hover="Contact">Contact</a></li>
<script>
$(document).on('click', 'a', function(event) {
if($(this).data('hover') !== "Blog"){
event.preventDefault();
$('html, body').animate({
scrollTop: $( $.attr(this, 'href') ).offset().top
}, 500);
});
</script>