Originally posted: April 6, 2006
Drag and drop is a popular javascript element that developers can use to make their webpages look cooler or function alot better. Imagine rearranging 125 elements on a page....that would be quite troublesome.
At work I used the Open Rico project handle my drag and drop. I customized my draggables and dropzone. One thing that wasn't apparent to me at the time was scrolling while dragging. The element your dragging follows the mouse but what happens with the dropzone? It doesn't update with the position. This effect is not noticable with a small screen but when the page expands vertically it is noticable. Click here to see their implementation (Drag and Drop Open Rico)
What I had to do to fix this problem is to get the correct range of the box when the code checks for if the element is in a drop zone. Basically I changed most of their code to use RicoUtils.docScrollTop() to get the new vertical position. To get the correct rectangular position I used this simple idea: call absoluteRectangle, this returns the position of the rectangle (or dropzone), now you will add (startingScrollTopPosition - currentScrollTopPosition).
Maybe I am a noob, but everything works perfectly in Firefox and IE, so I am a happy man, but if this could've been done easier, please leave me a comment.
Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts
Tuesday, 10 June 2008
Using Javascript
Originally posted: March 19, 2006
I remember when I was young javascript was used to make things look cool. Ie. menus or making things move from one side of the page to the other.
As I got to university people I knew started using the fading and animation of text to make their AsianAvenue.com pages funky.
Then at work this term, I overheard, AJAX. What is this? Asynchronous Javascript with XML, Okiee...this is a pretty nice concept that is being used on alot of new pages online. Led by the force of Google and Yahoo people are jumping on this bandwagon like crazy.
I too have jumped on this bandwagon. Deciding to make my application a rich app web applicaton by using the ideas and concepts from AJAX such as drag and drop, in line editing and loading messaging. This is truly an interesting project...never knew you could have classes in javascript. lol. DHTML...i remember i was trying to learn this when i was younger. Now it comes back to the forefront. Which bandwagon did I jump on? Projects that used the Prototype.js, script.aculo.us and open rico. (http://www.musingsfrommars.org/2006/03/ajax-dhtml-library-scorecard.html)
I remember when I was young javascript was used to make things look cool. Ie. menus or making things move from one side of the page to the other.
As I got to university people I knew started using the fading and animation of text to make their AsianAvenue.com pages funky.
Then at work this term, I overheard, AJAX. What is this? Asynchronous Javascript with XML, Okiee...this is a pretty nice concept that is being used on alot of new pages online. Led by the force of Google and Yahoo people are jumping on this bandwagon like crazy.
I too have jumped on this bandwagon. Deciding to make my application a rich app web applicaton by using the ideas and concepts from AJAX such as drag and drop, in line editing and loading messaging. This is truly an interesting project...never knew you could have classes in javascript. lol. DHTML...i remember i was trying to learn this when i was younger. Now it comes back to the forefront. Which bandwagon did I jump on? Projects that used the Prototype.js, script.aculo.us and open rico. (http://www.musingsfrommars.org/2006/03/ajax-dhtml-library-scorecard.html)
Subscribe to:
Posts (Atom)