dutchcelt/Keep-in-View — Issue #2: An alternative method to implement
Author: utensil
Created: 2012-02-08 08:16:42+00:00
State: open

```javascript
var alwaysTopTips = function(e) {
//if it's just div etc.
//$( "#the_target" ).position({of: window, my: 'top', at: 'top', offset:0, collision: 'flip'});
//if it's a jQuery UI dialog
// $( "#the_target" ).dialog({ position: ['center' , 'top'] });
};

$(window).bind('scroll', alwaysTopTips);

//later if need to unbind
$(window).unbind('scroll', alwaysTopTips);
```

To scratch my own itch, I implemented the similar function in the code sample above, though didn't generalize it to a plugin.
Just paste here for a reference, basically a one-line implementation if unbind and name collision avoid is not required.