Today i started reading Practical Prototype and script.aculo.us By Andrew Dupont.
Nice book written by Andrew Dupont.
I want to share few quotations i found from this book from the remaining chapters.
1) Drag-and-drop is a UI pattern that seems to have been around since the mouse was invented, but until recently it wasn’t used very often in web applications. But why not? The technological capabilities are there. DOM scripting lets us listen for the mousedown, mousemove, and mouseup events that comprise a drag. It also lets us modify the CSS positioning of an element so that it can "follow" the mouse pointer around the screen.
2) Exploring Draggables
In script.aculo.us, a draggable is anything that can, not surprisingly, be dragged around the page. There are a number of things you can customize about the drag itself, but the simplest way to make something draggable is to declare a new instance of the Draggable class:
new Draggable('some_element');
3) Adding Autocomplete Functionality
Autocompleter is a control similar to the one built into browsers: when the user begins to type in a text box, a menu appears below the text offering completion suggestions. All major web browsers use this type of UI control for their address bars—typing the beginning of a URL will display a list of URLs in your history that begin with what you’ve typed. Most also use it on any input field you’ve typed text into before, although that depends on whether you’ve configured your browser to remember those values.
The script.aculo.us autocompleter replicates this control, but gives the developer control of the suggestion list. It does so by augmenting an ordinary text box (an input with a type of text) with an element for displaying the results (typically a div with a ul inside) and a listener on the text box that observes what’s being typed.
About the Author
ANDREW DUPONT is a UI developer living and working in Austin, Texas. He is a member of the core development team for Prototype, the popular JavaScript toolkit. He has contributed to Prototype in many different ways: writing code and documentation, offering support, and evangelizing to colleagues. In addition, Andrew has spoken about JavaScript at South by Southwest Interactive and other tech industry conferences.
Andrew received liberal arts and journalism degrees from the University of Texas at Austin. He occasionally attended classes, but much preferred the time between classes, during which he experimented with web design and learned about the emerging web standards movement.
Thursday, 4 December 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment