Okay.  I figured it out.  Since smartPosition was tracking the moving
div, and since the moving div was always in the same place after the
initial switch, the calculations weren't returning the div upon scroll
up.

I changed the smartPosition param to #content-area, which was a parent
of the #post-navigation class.  It's working now.  And beautifully,
too.

Thanks for the help!
Brad Kovach
bradkovach.com

On Apr 5, 5:17 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> I have only had a look round at the code I have in  a wordpress install with
> k2, I have not upgraded either since 2.5 came out.
>
> Make sure you have this somewhere
>
> jQuery(document).scroll(function() { smartPosition('.configstuff') });
>
> possibly the k2 jquery pack includes dimensions plugin or something
>
> -S
>
> On 05/04/2008, Brad <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm using some code that I found in the K2 theme for WordPress.
>
> > function smartPosition(obj) {
> >         // Detect if content is being scroll offscreen.
> >         if ( (document.documentElement.scrollTop ||
> > document.body.scrollTop)
> > >= jQuery(obj).offset().top) {
> >                 jQuery('body').addClass('smartposition');
> >         } else {
> >                 jQuery('body').removeClass('smartposition');
> >         }
> > }
>
> > It's supposed to add and remove the `smartposition` class when the
> > scrolling threshold is right.  It works perfectly in K2.
>
> > I have the style
>
> > body.smartposition #post-navigation {
> >   background:#FFFFFF none repeat scroll 0% 0%;
> >   border-bottom:1px solid #EEEEEE;
> >   margin:0pt;
> >   padding:10px 0pt;
> >   position:fixed;
> >   top:0px;
> >   z-index:10;
> > }
>
> > In my stylesheet, but the problem is that the class isn't removing!

Reply via email to