不确定如何将Javascript代码添加到Tumblr

我从这里得到了代码,rossipedia的主要解决方案: 修复侧边栏直到div

这是我的Tumblr页面和脚本影响的部分代码(main替​​换为内容):

   ...  #sidebarwrap { margin: 0 0 1.5em; width: 16.2em; float: left; position: relative; } #sidebar { margin: 0 0 1.5em; width: 16em; height: 570px; position: absolute; } #sidebar.fixed { position: fixed; top: 0; } #footer { border-top: 4px solid {color:Footer Border}; background: {color:Footer Background}; color: {color:Background}; clear: both; margin: 0; overflow: auto; padding: 0 0.5em; } #content { margin-bottom: 4.5em; margin-left: 18.5em; min-width: 500px; min-height: 550px; }   

身体

  
...Stuff...

然后我将脚本包含在/ body之前,如下所示:

  ...Script...  

我一直在进行拼写检查并确保一切正常,但这一切都无济于事。 至少不是那个JS。 我使用的其他JS工作得很好……脚本应该让我的侧边栏向用户滚动,然后在重叠页脚之前停止。 然而,脚本行为喜欢它甚至不存在,侧边栏不会移动一英寸…哎呀,我甚至篡改了它的小提琴页面上的原始,使其与我的页面相同的布局和排序,它仍然工作得很好。

我错过了什么吗? 每个人都在谈论JQuery,我不完全确定那是什么,或者我是否应该使用它…如果有人能帮我看看我做错了什么,我真的很感激! :“d

看起来您需要在页面上加载jQuery以使用您添加的代码。 jQuery是一个JavaScript库; 它提供了“$”function。

要在页面中加载jQuery,请固定侧边栏代码之前添加: