The creativity in web programming
One of the things I like about web programming is that you have to use lot of creativity to come up with solutions. You have to hack your way through.
This of course can be tiresome, but I think it spices things up. An example is to properly focus an element you have to use shit loads of hacks (using scrollTop does not work cross browser). The final solution that works cross browser looks like this: function focusTrick(elm) {
var a_tag = A({name: 'fluffy', href:'#', s: 'display: block; height: 50px;'}, 'Test');
a_tag.style.color = '#fff';
ACN(elm, a_tag);
a_tag.focus();
setTimeout(function() {
discardElement(a_tag);
}, 10);
}
Code
·
JavaScript
·
Tips
•
22. Feb 2008
|
|