Building SlideSix - Part 3
Another quick highlight of SlideSix is the super cool shadowbox jQuery plugin used to embed the video how to's.
I have to admit I really didn't do much more then copy/paste (gasp!) the code from the inline video player demo that ships with the shadowbox download. I wanted something quick and dirty, so I didn't bother to dig in deeply into the code, but here's the script:
return el.className && el.className == cls;
};
var escapeHTML = function(html){
return html.replace(/</g, '<');
};
window.onload = function(){
var S = Shadowbox;
S.init({
flvPlayer: '/includes/js/shadowbox-1.0/flvplayer.swf',
autoplayMovies: false // don't automatically play movies
});
var a = document.getElementsByTagName('a'); // live node list
var links = [];
for(var i = 0, len = a.length; i < len; ++i){
if(hasClass(a[i], 'vidplayer')){
links[links.length] = a[i];
}
}
var obj, markup, html;
for(var i = 0, len = links.length; i < len; ++i){
var link = links[i];
obj = S.buildCacheObj(link);
markup = S.movieMarkup(obj);
html = S.createHTML(markup);
link.parentNode.innerHTML = html;
}
};
Basically the script looks for every <a> tag with a class of 'vidplayer' and replaces the tag contents with a SWF viewer for the FLV vids.
I did peek into the plugin a bit, and it is very configurable by simply passing in some arguments to the shadowbox constructor. Here is what one of my <a> tags looks like:
Can't get much easier then that.



There are no comments for this entry.
[Add Comment]