SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 251 | Next

Jonathan Snook, Aaron Gustafson, Stuart Langridge, and Dan Webb

"Accelerated DOM Scripting with Ajax, APIs, and Libraries"

without( id );
}
this.processes = this.processes.without( id );
},
The final little tweak has to do with bookmarking. You want the answers to be bookmarkable
so that the following are true:
??? The bookmarked question automatically opens when the page loads.
??? If someone links to a bookmark, and the person following that link doesn??™t have
JavaScript enabled, the bookmark will work for the second user, too.
??? The page won??™t jump to the anchor reference when it loads (because you want the
script to control the scrolling if it can).
One way to meet all these needs is to do a little dynamic id rewriting and then set the
script to transpose any fragment identifier found in the URI string to the new id schema and
trigger the referenced dd to open. You do this so the id referenced can??™t be found, enabling
JavaScript to control the scroll. All the logic goes into FAQ.initialize():
initialize: function(){
...cut...
$$( 'dl.faq' ).each( function( dl ){
...cut...
$A( dl.getElementsByTagName( 'dd' ) ).each( function( dd ){
...cut...
// Reset the ID (so we can keep bookmarking active)
var new_id = 'FAQ_' + dd.getAttribute( 'id' );
dd.setAttribute( 'id', new_id );
// Close this DD
dd.heightFX.set( 0 );
}.bind( this ) ); // End DD Loop
// Loop through the ANCHORs
$A( dl.getElementsByTagName( 'a' ) ).each( function( a ){
var href = a.getAttribute( 'href' );
CHAPTER 8 n CASE STUDY: FAQ FACELIFT 186
/* Drop out if the link is not an in-page ANCHOR
or if it's TARGET cannot be found */
if( !href.


Pages:
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6