On Thu, 20 Nov 2008 11:22:51 -0800, Martin Rinehart wrote:
Quote:
I have been informed (by informed people) that if I want to drag
something around the screen I should write my own code because the
available stuff is not very good. (That was actually put less kindly in
the originals.)
>
Is this true? What is wrong with the other stuff? What would
characterize good dragging code?
A vast majority of Javascript code out there is, to put it kindly, total
crap for one out of three reasons.
1) Using browser sniffing instead of feature detection. There has been
a lot written about the two approaches, I won't repeat it here.
2) Relying on a frame work. The various frame works are all criticized
for different reasons. At absolute BEST they are large and cumbersome.
At worst, they are very delicate on the inside and prone to breaking on
slight browser changes and lack of support for "minor" browsers.
3) Written by inexperienced hands. This is a tough one, because a
novice, trying to write his own code, might not too much better than some
of the stuff out there. I really do understand the desire to simply snag
something that *works* and move on.
I've never written drag code, or I'd share it with you. In all of my
designs, I realized that by the time I made my web page usable on small
screens and print outs, that the drag-code had to go anyways. (My
biggest web page is a parts lookup -- I have people on iphones using this
while crawling over their bikes, ordering parts.)
On the other hand, I couldn't imagine a site like meebo.com working
without some sort of drag code. ;)