Salut tout le monde,
J'ai fait une petite fonction en JS qui affiche ou masque un bloc, et change le curseur d'un autre bloc pour refleter la fonction. Voici un exemple en action :
http://www.simo-multimedia.com/tmp/curs ... wHide.htmlRemarquez bien le comportement du curseur lorsque vous cliquez sur le titre.
Vous remarquerez qu'au bout de 3 clics, le curseur ignore ce que la fonction JS lui demande et retourne à un curseur normal.
Si par contre j'utilise des curseurs par défauts (ex. pointer, n-resize... etc.), ça marche parfaitement...
Voici le code source en abregé :
Code :
<html>
<head>
<script language="javascript">
<!--
function fnExpandCollapse(callingSection, calledSection)
{
if (calledSection.style.display == 'none')
{
calledSection.style.display = 'block';
callingSection.style.cursor = "url('http://www.simo-multimedia.com/tmp/cursors/expandUp.cur')";
}
else
{
calledSection.style.display = 'none';
callingSection.style.cursor = "url('http://www.simo-multimedia.com/tmp/cursors/expandDown.cur')";
}
}
//-->
</script>
</head>
<body>
<div onclick="fnExpandCollapse(this, document.getElementById('contenu'))" style="cursor:url('http://www.simo-multimedia.com/tmp/cursors/expandDown.cur');font-weight:bold;">
Titre
</div>
<div id="contenu" style="display:none;">
Lorem Ipsum Dolor Sit Amet. Lorem Ipsum Dolor Sit Amet. Lorem Ipsum Dolor Sit Amet.
</div>
</body>
</html>
Quelqu'un a une idée du problème?
Merci,
Simo