Cannot use this plugin with .scrollTop
-
Hello Max,
This is not a problem with the plugin itself, but you may have an easy fix for me. I am a bit of a noob when it comes to javascript and I have installed your plugin to get a sidebar widget to stick to the top of the window when scrolled past.
This has worked great so far however I have recently created another Div that appears upon scrolling. (similar to a mashable post page where the share buttons appear upon scrolling)
I use the following javascript to get this to work:
var $j = jQuery.noConflict(); var startY = $j('.main-navigation').position().top + $j('.main-navigation').outerHeight(); $j(window).scroll(function(){ if( $j(this).scrollTop() > startY ){ $j('.floating-share-bar').slideDown(); }else{ $j('.floating-share-bar').slideUp(); } });This stops my sidebar widget from sticking and I presume it is because the plugin also uses .scrollTop.
Any ideas on how I could overcome this?I know it is nothing to do with the plugin but it might be useful for this forum if others wanted to do something similar.
James
The topic ‘Cannot use this plugin with .scrollTop’ is closed to new replies.