Skip to content

Instantly share code, notes, and snippets.

@juareznjunior
Created September 28, 2011 19:39
Show Gist options
  • Save juareznjunior/1249005 to your computer and use it in GitHub Desktop.
Save juareznjunior/1249005 to your computer and use it in GitHub Desktop.
var loadDivs = function() {
// private
var param = location.search.split("?")
,i18n = {
'br': 'br'
,'en': 'en'
,'es': 'es'
};
// private
var fade = function($elem,fn) {
$elem.fadeOut('slow',function(){
$elem.load('ajax_discentes.phpl='+i18n[param],function(){
$elem.fadeIn('slow',function(){
setTimeout(function(){
loadDivs[fn]();
},5000)
});
});
});
}
// setter
param = param[1].split("=");
return {
'slide': function() {
fade($('#slide'),'slide');
}
,'perfil': function() {
fade($('#perfil'),'perfil');
}
}
}();
$(function(){
loadDivs.slide();
loadDivs.perfil();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment