It would probably be simpler and look better to just use fixed positioning. This will not work for IE 6 and below though. If that's important to you (and I think it would/should be), there's a fairly simple workaround for that.
For fixed positioning, you just use style, say your element has a class of fixedPos (for example, in your stylesheet):
Code:
.fixedPos {
position: fixed;
left: 30px;
bottom: 20px;
}
Then for IE 6 and less, you can add this conditional code and stylesheet below that:
Code:
<!--[if lt IE 7]>
<script type="text/javascript">
function fixedIE(tl, n){
var sc='scroll'+tl, d=document, c='compatMode';
return d[c] && d[c]=='CSS1Compat'? d.documentElement[sc]+n+'px' : d.body[sc]+n+'px';
}
</script>
<style type="text/css">
.fixedPos {
position:absolute;
left:expression(fixedIE('Left',30));
}
</style>
<![endif]-->
Bookmarks