0
Ci-dessous mon fichier jasx où je suis notamment menu.jsjQuery ne fonctionne pas dans JSF (ICEfaces)
<head>
<script src="/js/menu.js" type="text/javascript">
</script>
</head>
menu.js
function initMenu() {
alert("ok");
$('#menu ul').hide();
$('#menu li a').click(
function() {
var checkElement = $(this).next();
if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
$('#menu ul:visible').slideUp('normal');
return false;
}
if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
$('#menu ul:visible').slideUp('normal');
checkElement.slideDown('normal',function(){
var offset = $(this).offset();
$('#menu li a').removeClass('selected');
$(this).parent().find('a:first').addClass('selected');
var margin_top = offset.top-210;
$('div#current').animate({'margin-top':margin_top},2000,'easeOutBounce');
});
return false;
}
}
);
}
$(document).ready(function() {initMenu();});
Dites-moi si votre fonction init est appelée? –
aucune fonction init n'est appelée – chetan