'jQuery doesn't know function scrollTop
I want do create a div, which is scrollable in y-direction, but is fixed in x-direction. I already got help with it, here it works: http://jsfiddle.net/Q4dWz/
But somehow it doesn't want to work at home. I've downloaded the latest jquery:
wget -O jquery-1.5.min.js http://code.jquery.com/jquery-1.5.1.min.js
Everytime i call scrollTop I get it says that scrollTop is not a function :( http://gbimg.org/p.php?q=BRYaL I do not understand why it is not a function, and I don't understand, why Firebug says something about jquery 1.2.1 (look at the picture). Here is the code:
160 $(document).ready(function() {
161 $(window).scroll(function(){
162 var $win = $(window);
163 $('#zeit').css('top', 20 - $win.scrollTop());
164 });
165-238 some other functions
238 });
Solution 1:[1]
Likely you have a collision with the $
variable in your home environment being set to two jQuery versions, and thus var $win = $(window);
is setting $win
to a jQuery 1.2.1 object without the required scrollTop
function. If you look at the jQuery scrollTop page, you will see that scrollTop
was introduced in version 1.2.6.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |