Geeks With Blogs

News




What I do:

Identity Mine

MVVM Light

GalaSoft


What I am:

Microsoft Most Valuable Professional, Client Application Development

Microsoft Certified Technology Specialist, Windows Presentation Foundation

WPF disciples


Social:


View my profile on LinkedIn

XING
Creative Commons License
Diary of a Code Trotter by Laurent Bugnion is licensed under a Creative Commons Attribution 3.0 Unported License

All source code on this blog is licensed under the MIT license.

Copyright (c) 2006 - 2011 GalaSoft Laurent Bugnion

Laurent Bugnion (GalaSoft) Diary of a Code Trotter
Continuing to clean up the DHTML effects I use on my site (see my previous post), I published a Positioning and Scrolling effect. It's quite handy, in that it allows to easily keep a DOM node (DIV, ...) in sight of the user at all times. This can be used, for example, for a "floating menu" like I have on my main page.
The DOM node moves with a variable speed. What I especially like in the way this effect is implemented is that the user can specify his own function to calculate the speed of the DOM node according to the distance to the target position. Of course I provide a default function, which is a factor of the square of the distance. This way, the Node "glides" smoothly to the position.
The Node can be repositioned either manually by calling a method, or when the user scrolls the page. Additionally, it can be pinned in both axis separately, so that it stops repositioning itself.
Posted on Monday, January 15, 2007 9:38 PM Technical stuff , JavaScript | Back to top


Comments on this post: DHTML effect: Positioning

Comments are closed.
Comments have been closed on this topic.
Copyright © Laurent Bugnion | Powered by: GeeksWithBlogs.net