11548 sujets

JavaScript, DOM et API Web HTML5

bonjour,

j'ai un code simple avec jquery j'aimerai fait une synchronisation entre les deux menu c a dire au moment qu'il clique sur un l'autre (menu) affiche le contenu:

[b]<script type="text/javascript">
	jQuery().ready(function(){
		// simple accordion
		jQuery('#list1a').accordion({
		
			autoheight: false
		});
		jQuery('#list1b').accordion({
		alwaysOpen: false,
			autoheight: false
			
		});
	});
	</script>[/b]


mon HTML:

	<div class="basic" style="float:left;"  id="list1a">
			<a>There is one obvious advantage:</a>
			<div>
				<p>
					You've seen it coming!<br/>
					Buy now and get nothing for free!<br/>
					Well, at least no free beer. Perhaps a bear,<br/>
					if you can afford it.
				</p>
			</div>
			<a>Now that you've got...</a>
			<div>
				<p>
					your bear, you have to admit it!<br/>
					No, we aren't selling bears.
				</p>
			</div>
			<a>Rent one bear, ...</a>
			<div>
				<p>
					get two for three beer.
				</p>
				<p>
					And now, for something completely different.<br/>
					And now, for something completely different.<br/>
					And now, for something completely different.<br/>
					And now, for something completely different.<br/>
					And now, for something completely different.<br/>
					And now, for something completely different.<br/>
					And now, for something completely different.<br/>
					And now, for something completely different.<br/>
					Period.
				</p>
			</div>
		</div>
			
		<div class="basic" style="float:left; margin-left: 2em;" id="list1b">
			<a>There is one obvious advantage:</a>
			<p></p>
			<a>Now that you've got...</a>
				<p></p>
			<a>Rent one bear, ...</a>
				<p></p>
		</div>



donc je clique sur le menu "list1b" et la partie list1a affiche le contenu.

merci