![]() |
||||
|
||||
Week Six JavaScripting NotesTonight we are going to look at JavaScript libraries to gain exposure to potential implementations. Working with JavaScript FrameworksWe have already been exploring the JQuery framework, but we'll take a look at some other JavaScript frameworks as well. We'll start with the Highslide framework that is fully presented at http://highslide.com/.
lang : {
cssDirection: 'ltr',
loadingText : 'Loading...',
loadingTitle : 'Click to cancel',
focusTitle : 'Click to bring to front',
fullExpandTitle : 'Expand to actual size (f)',
creditsText : '',
creditsTitle : '',
restoreTitle : 'Click to close image, click and drag to move.
Use arrow keys for next and previous.'
},
// See http://highslide.com/ref for examples of settings
graphicsDir : 'highslide/graphics/',
expandCursor : 'zoomin.cur', // null disables
restoreCursor : 'zoomout.cur', // null disables
expandDuration : 250, // milliseconds
restoreDuration : 250,
marginLeft : 15,
marginRight : 15,
marginTop : 15,
marginBottom : 15,
[...]
Let's try changing some of those together to see what they do for us. If only every Framework were so easy to use! We'll focus on just the slide presentation feature from the HighSpace framework and create our own simple example. Example of a single feature framework add-onSome JavaScript code documents available on Web incrementally add visible features to a website. For example, take a look at a JavaScript document available on-line to support vertical scrolling (latest full version website here). Note once again how useful parameters are made available at the top of the code file. The use of a pound sign in front of bookmark target is usually reserved for the href attbribute value. The author has chosen a familiar syntax and yet placed the syntax with a non-standard attribute value. When you use a framework, you should ask yourself if there is bound to be collisions between framework use and any other technology you might use. We implemented the vertical scrolling feature in class to recreate our own example here. Let's take a look at some of the JavaScript features previous students of this class borrowed from available libraries and frameworks they found on-line: Photo Scroller featureMaureen based her project a photoscroller feature as demonstrated here. Only the content for image #6 has been uploaded. JQueryRotate JQuery Plug-inA plugin is a means by which you can incrementally grow a framework without having to include all features at once. JQuery plug-ins have been developed because JQuery provides a simple plug-in interface. Let's try using one together.
A Dragging FrameworkChristelle provided the dragdealer framework as an example of a framework that actually has good documentation and an explicit API. Let's try out using it together in class as an example of using a framework from scratch. |
||||