Magazine
 
Quick Review:Ajax
 
Ajax and XML: Five cool Ajax widgets
 

var items = data.match( /(\<img .*?\>)/g );
for (i = start; i <= last; i++) {
if ( items[ i - 1 ] == undefined ) break;
var item = carousel.add( i, getItemHTML( items[i-1]) );
item.each(function() {
jQuery(“a.thickbox”, this).click(function() {
var t = this.title || this.name || null;
var g = this.rel || false;
TB_show(t,this.href,g);
this.blur();
return false;
});
});
}
carousel.loaded();
};
function getItemHTML( item ) {
var found = item.match( /href=\”(.*?)\”/ );
var url = jQuery.trim(found[1]);
var title = jQuery.trim(found[1]);
var url_m = url.replace(/_s.jpg/g, ‘_m.jpg’);
return ‘<a href=”’ + url_m +
‘“ title=”’ + title +
‘“ class=”thickbox”><img src=”’ + url +
‘“ width=”’ + 75 + ‘“ height=”’ + 75 +
‘“ alt=”’ + title + ‘“ /></a>’;
};
var nextOver = function() {
jQuery(this).attr(“src”, “img/horizontal-ie7/next-over.gif”); };
var nextOut = function() {
jQuery(this).attr(“src”, “img/horizontal-ie7/next.gif”); };
var nextDown = function() {
jQuery(this).attr(“src”, “img/horizontal-ie7/next-down.gif”); };
function nextButtonStateHandler(carousel, button, enabling) {
if (enabling) {
jQuery(button).attr(“src”, “img/horizontal-ie7/next.gif”)
.mouseover(nextOver).mouseout(nextOut).mousedown(nextDown);
} else {
jQuery(button).attr(“src”, “img/horizontal-ie7/next-disabled.gif”)
.unmouseover(nextOver).unmouseout(nextOut).unmousedown(nextDown);
}
}
var prevOver = function() {
jQuery(this).attr(“src”, “img/horizontal-ie7/prev-over.gif”); };

Apr 2008 | Java Jazz Up | 58
previous
index
next
 
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70, 71, 72, 73, 74, 75, 76, 77, 78,   Download PDF