/** jQuery related functions and calls */ // cufon replacements initCufon(); $('document').ready(function() { // hide the loading div $('#details, #loading').hide(); // when a tshirt is clicked $('ul#tshirts li a').click(function() { // loading msg $('#details').hide(); $('#loading').show(); // empty the team's details to prevent glitches where you see a millisecond of the previous team member emptyTeamDetails(); // do a call to ajax.php with the ID of the team member coming from the rel attribute on the links if($.getJSON('http://www.chocoweb.be/content/core/ajax.php', {'id' : $(this).attr('rel')}, parseTeamDetails)); }); // close team details $('#details .close').click(function() { $('#details').hide(); }); // clicking on the subscribeform's input field will make the text disappear $('#email').focus(function() { if($(this).attr('value') == 'jouw email-adres hier') $(this).attr('value', ''); }); // if nothing was entered, re-enter the message $('#email').blur(function() { if($(this).attr('value') == '') $(this).attr('value', 'jouw email-adres hier'); }); /* // lightbox $(function() { $('a[rel=lightbox]').lightBox(); }); */ // prettyPhoto $(function() { $('a[rel^=lightbox]').prettyPhoto({ theme: 'dark_rounded' }); }); // datagrid table row hovers $('tbody tr').hover(function() { $(this).toggleClass('hover'); }, function() { $(this).toggleClass('hover'); }); jQuery('#droplist li div').hide().prev('a').mouseover(function(){ jQuery('#droplist li div:visible').hide(); jQuery(this).next('div').show(); }); }); function parseTeamDetails(info) { // hide the loading message $('#loading').hide(); // parse info in the details $('#details h2').html(info.first_name+' '+info.name); $('#details img').attr('src', 'http://www.chocoweb.be/uploads/team/'+ info.image); $('#description').html(info.description); // show the details $('#details').show(); // reinit cufon (again yes, text needs to reparse) initCufon(); } function emptyTeamDetails() { // parse info in the details $('#details h2').html(' '); $('#details img').attr('src', ''); $('#description').html(''); } function initCufon() { // cufon replacements //Cufon.replace('h2'); //Cufon.replace('h3'); /*jQuery(document).ready(function() { jQuery('.button:not(.nocufon)').each(function(n, el) { Cufon.replace(el); }); });*/ Cufon.replace('.input-button'); }