Je vais essayer d'être plus explicite avec les exemples suivants :
la première partie contient la map area avec l'info-bulle qui se ferme par action de l'internaute :
<HTML> <HEAD> <TITLE>TEST JS</TITLE> <SCRIPT language="JavaScript1.2" src="main.js"type="text/javascript"></SCRIPT> </HEAD> <body topmargin="15" leftmargin="15" > <DIV id="TipLayer" style="visibility:hidden;position:absolute;z-index:1000;top:-100"></DIV> <SCRIPT language="JavaScript1.2" src="style.js" type="text/javascript"></SCRIPT> <IMG src="images/exemple.gif" usemap="#exemple"> <map name="exemple"> <area shape="circle" coords="30,30,21" title="Un cercle" href="#" onMouseOver="stm(Text[8],Style[5])" onmouseout="htm()"> </map> </BODY> </HTML>
En second lieu j'aimerai inserrer le menu accordéon suivant :
<head>
<script type="text/javascript" src="jquery-1.2.2.pack.js"></script>
<script type="text/javascript" src="ddaccordion.js">
/*********************************************** * Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * Visit http://www.dynamicDrive.com for hundreds of DHTML scripts * This notice must stay intact for legal use ***********************************************/
</script>
<script type="text/javascript">
ddaccordion.init({ headerclass: "silverheader", //Shared CSS class name of headers group contentclass: "submenu", //Shared CSS class name of contents group revealtype: "mouseover", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover collapseprev: true, //Collapse previous content (so only one open at any time)? true/false defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc] [] denotes no content onemustopen: true, //Specify whether at least one header should be open always (so never all headers closed) animatedefault: false, //Should contents open by default be animated into view? persiststate: true, //persist state of opened contents within browser session? toggleclass: ["", "selected"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"] togglehtml: ["", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs) animatespeed: "normal", //speed of animation: "fast", "normal", or "slow" oninit:function(headers, expandedindices){ //custom code to run when headers have initalized //do nothing }, onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed //do nothing } })
</script>
<style type="text/css">
.applemenu{ margin: 5px 0; padding: 0; width: 150px; /*width of menu*/ border: 0px solid #9A9A9A; height: 10px; }
.applemenu div.silverheader a{ background: black url(silvergradient.gif) repeat-x center left; font: normal 12px Arial; color: white; display: block; position: relative; /*To help in the anchoring of the ".statusicon" icon image*/ width: auto; padding: 5px 0; padding-left: 8px; text-decoration: none; }
.applemenu div.silverheader a:visited, .applemenu div.silverheader a:active{ color: white; }
.applemenu div.selected a, .applemenu div.silverheader a:hover{ background-image: url(silvergradientover.gif); color: white;
}
.applemenu div.submenu{ /*DIV that contains each sub menu*/ background: white; padding: 2px; font: normal 12px Arial; height: auto; /*Height that applies to all sub menu DIVs. A good idea when headers are toggled via "mouseover" instead of "click"*/ } </style> </head> <body> <div class="applemenu"> <div class="silverheader"><a href="" >Menu 1</a></div> <div class="submenu"> Some random content Some random content </div> <div class="silverheader"><a href="">Menu 2</a></div> <div class="submenu"> Some random content here<br /> </div> <div class="silverheader"><a href="">Menu 3</a></div> <div class="submenu"> Some random content here<br /> </div> <div class="silverheader"><a href="http://www.codingforums.com">Menu 4</a></div> <div class="submenu"> Some random content here<br /> </div> </div> </body> </html>
Chacun des menus seraient un id différent et seraient appelé dans la ligne de la zone concernée.
|