#makefixed.js
MakeFixed.js is a quick way to dynamically set up elements to be fixed during scroll.
- Lightweight! Less than 2.4KB;
- Allow callback functions;
- jQuery required.
$('.fixed').makeFixed();
In this example, we have several elements using the class .fixed But we gonna work on a specific element when fixed, id #photo.
$('.fixed').makeFixed
({
onFixed: function (el)
{
if ($(el).attr('id') == 'photo')
{
$(el).children().css
({
width: '500px'
});
}
},
onUnFixed: function (el)
{
if ($(el).attr('id') == 'photo')
{
$(el).children().css
({
width: '450px'
});
}
}
});
Tweet me: @guimadaleno
GNU GPL
Enjoy \o