var $obiwi = jQuery.noConflict(); $obiwi(document).ready(function() { // Carrousel //$obiwi("#SelectionHomeUne .home-une ul").tabs({event:"mouseover"}); $obiwi("#SelectionHomeUne .home-une #onglets").tabs(); $obiwi("#SelectionHomeUne .home-une #onglets").tabs('rotate', 10000); // Bloc Photos et vidéos. Clic sur une image montre le texte ad hoc. $obiwi("#SelectionHomeVideo img").each(function(index, sourceobject) { $obiwi(this).hover( function() { $obiwi("#SelectionHomeVideo div.home-videos div.holder:not(#holder-" + index + ")").removeClass("selected"); $obiwi("#SelectionHomeVideo div.home-videos div.holder div.FlechePhotoVideo:not(#fleche-" + index + ")").hide(); $obiwi("#SelectionHomeVideo div.home-videos div.home-videos-texte:not(#home-videos-" + index + ")").hide(); $obiwi("#SelectionHomeVideo div.home-videos #holder-" + index).addClass("selected"); $obiwi("#SelectionHomeVideo div.home-videos #fleche-" + index).show(); $obiwi("#SelectionHomeVideo div.home-videos #home-videos-" + index).show(); }, function () {} ); }); /********************* * pour chaque span, regarder sa hauteur et celle du li parent, hauteur_parent - hauteur_span = espace qui reste en bas * on en met une moitié en padding-top et ca centre les textes des onglets, qu'ils soient sur 1, 2 ou 3 lignes */ $obiwi("#onglets ul.ui-tabs-nav li a span").each(function(index,sourceobject) { var height_parent = $obiwi("#onglets ul.ui-tabs-nav li:eq(" + index + ")").height(); var height_left_by_two = (height_parent - $obiwi(this).height() ) / 2; //alert(height_parent + "\n" + $obiwi(this).height() + "\n" + height_left_by_two); $obiwi(this).css("padding-top",height_left_by_two); $obiwi(this).css("height",height_parent - height_left_by_two); }); /* Chaque span contient un attribut ref qu'on utilise en remplacement du href monopolisé par les tabs() ANCIEN COMPORTEMENT, onglet activé par clic et ne mène plus à l'article qd clic $obiwi("#onglets ul.ui-tabs-nav li a span").click(function(){ if ($obiwi(this).parent().attr('rel') != '') { top.location = $obiwi(this).parent().attr('rel'); } return false; }); */ // Quand tous les éléments visuels sont prets, afficher les articles avec photos $obiwi("#onglets").css("top","-248px"); $obiwi("#SelectionHomeUne .AntiGhost").fadeIn(500); });