I came across a technique mentioned here that I wanted to implement. I used this jsfiddle link (which worked well) to create my own version http://jsfiddle.net/a2q7zk0m/1/, along with a custom menu. However, now it seems like it's not working due to a possible JavaScript error:
$(document).ready(function() {
$(window).scroll(function(e) {
$el = document.getElementById('temp');
if ($(this).scrollTop() > 100) {
$el.addClass("fixedNav");
} else {
$el.removeClass("fixedNav");
}
});
});
It seems the script is having trouble recognizing the ID of the div and accessing the CSS class. Unfortunately, I can't use the class attribute here. Can anyone help me troubleshoot this issue? Thank you!