Homepage › Community Forums › SquareOne Theme Support › trying to link to JS and CSS for home page only › Reply To: trying to link to JS and CSS for home page only
I’m not sure if this will be helpful or not, (and you may already know this) but I noticed that this code is added on the front-page.php file –
// Adds javascript for scroll
add_action( 'genesis_after_footer', 'scroll_javascript' );
function scroll_javascript() { ?>
<!-- SMOOTH SCROLL -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
</script>
<!-- End of SMOOTH SCROLL -->
<?php
}
Which is supposed to add the smooth scroll javascript code for the arrow on the demo homepage. Maybe you could try editing the code above or copying it and adding in your own code to see if that helps.
