Working on blog.item in Squarespace Marquee
Using Affix from Twitter Bootstrap for blog posts, simple plug-in to keep the blog title ( on the left ) position: fixed; until it hits the top of the comments section, then switch to position: absolute;
Should be simple, but I can't get this to fire when it hits the top of the comments section. Errors every time.
When I opened up my console to debug, I can't find a single element on the page other than the body. This is obviously the issue, but I'm stumped.
Every element on the page returns "null" based on class or ID, even though it's 100% within the HTML of the page - I'm copying and pasting from my inspector.
ALL CONSOLE ACTIONS OTHER THAN $('body')
$('#comments')
null
THIS is the page I'm working on.
Any thoughts?
Thanks for the help! All up and running smoothly now, it was indeed a script tag issue.
Here's my final code:
$( function() {
$( '#myaffix' ).affix({
offset : {
bottom : function () {
return ( document.body.clientHeight - $( '#comments-outer-wrapper' )[ 0 ].offsetTop );
}
}
});
});