New file |
0,0 → 1,99 |
/** |
* Script JQuery du site |
* |
* @author Grégoire Duché <jpm@tela-botanica.org> |
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt> |
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt> |
* @version $Id$ |
* @copyright 2009 |
*/ |
|
var url_service_jrest = "http://162.38.234.3/jrest_tela/TelaUtilisateurs"; |
$(document).ready(function() { |
|
/** |
* Ajout de contenus : inscrits, connectés, et boutons précédents et suivants |
* */ |
|
// On ajoute les champs Inscrits et connectés uniquement si JS obtient une réponse du service |
$.getJSON(url_service_jrest, |
function(data){ |
var nbInscrits = data[0]; |
var nbVisiteurs = data[1]; |
|
$("#zone-menu-haut ul").prepend('<li class="vert" id="connectes"> Visiteurs : <span class="gris">' + nbVisiteurs + '</span></li>'); |
$("#zone-menu-haut ul").prepend('<li class="vert" id="inscrits"> Inscrits : <span class="gris">' + nbInscrits + '</span></li>'); |
}); |
|
/** |
* Gestion des effets graphiques sur bandeau |
* * |
TODO : supprimer les lignes ci-dessous |
$(".motsclefs").mouseover(function() { |
//Changer la couleur du titre. |
$(this).addClass("grisclair"); |
$(this).children("h3").children("span").addClass("grisfonce"); |
}); |
|
$(".motsclefs").mouseout(function() { |
//Changer la couleur du titre. |
$(this).addClass("grisfonce"); |
$(this).removeClass("grisclair"); |
$(this).children("h3").children("span").removeClass("grisfonce"); |
$(this).children("h3").children("span").addClass("grisclair"); |
});*/ |
|
$("#bandeauProjets").addClass("overflow-hidden"); |
$("#bandeauProjets").css("height", "100px"); |
$("#bandeauProjets ul").addClass("overflow-hidden"); |
$("#bandeauProjets ul").css("width", "9000px"); |
|
|
/******************************************************************************** |
* Gestion des projets - menu defilant * |
********************************************************************************/ |
/* Ajout à la volée des boutons suivant et précédent pour le menu défilant */ |
|
$("#bandeauProjets").append("<div id='boutonPrecedent'> </div>"); |
$("#bandeauProjets").append("<div id='boutonSuivant'> </div>"); |
|
/* Variables pour le défilement*/ |
var position = 0; |
var increment = 269; |
|
$("#boutonSuivant").click(function() { |
//Un clic sur le bouton "Projet suivant" doit défiler la liste des projets |
var ul = $(this).parent().children("ul"); |
var nbLi = ($(ul).children("li").size())-3; |
|
if (position/increment < nbLi) { |
position += increment; |
$(ul).animate({marginLeft: '-' + position}, 400, function() {}); |
} |
}); |
|
$("#boutonPrecedent").click(function() { |
//Un clic sur le bouton "Projet suivant" doit défiler la liste des projets |
if (position>0) { |
position -= increment; |
var ul = $(this).parent().children("ul"); |
$(ul).animate({marginLeft: '-' + position}, 400, function() {}); |
} |
}); |
|
if (navigator.appName=='Microsoft Internet Explorer') { |
$("#zone-titre").css("font-family", "optima2"); |
$(".motsclefs").css("font-family", "Helveticaneue2"); |
} |
} |
); |
|
/** |
* Vider le champ recherche lorsqu'on clique dessus. |
* */ |
//TODO : mettre les versions EN... |
function saisieChampRecherche(objet) { |
if (objet.value=="Rechercher dans le site") { |
objet.value = ""; |
} |
} |