ugrás a tartalomhoz

JQuery Accordion 2x beagyazva nem megy

elba · 2008. Már. 29. (Szo), 01.39
Hi,

Menut epitek es a kovetkezo problemaba szaladtam:
A kovetkezo JS-eket hasznalnam a menuhoz:
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.dimensions.js"></script>
<script type="text/javascript" src="js/accordion.js"></script>
<script type="text/javascript" src="js/prototype.lite.js"></script>
<script type="text/javascript" src="js/moo.fx.js"></script>
<script type="text/javascript" src="js/moo.fx.pack.js"></script>

http://www.elba00.ultraweb.hu alatt.

Ha megnezitek a 2 tab alatt a harmonika mukodik rendesen, azonba a 3. mar alatt nem.
A HTMLem a kovetkezo JSt tartalmazza:
<script type="text/javascript">
function init(){
	var stretchers = document.getElementsByClassName('box');
	var toggles = document.getElementsByClassName('tab');
	var myAccordion = new fx.Accordion(
		toggles, stretchers, {opacity: false, height: true, duration: 600}
	);
	//hash functions
	var found = false;
	toggles.each(function(h3, i){
		var div = Element.find(h3, 'nextSibling');
			if (window.location.href.indexOf(h3.title) > 0) {
				myAccordion.showThisHideOpen(div);
				found = true;
			}
		});
		if (!found) myAccordion.showThisHideOpen(stretchers[0]);
}
jQuery().ready(function(){
		// simple accordion
		jQuery('#list1a').accordion();
		jQuery('#list1b').accordion({
			autoheight: false
		});
		
		// bind to change event of select to control first and seconds accordion
		// similar to tab's plugin triggerTab(), without an extra method
		var accordions = jQuery('#list1a, #list1b, #list2, #list3, #navigation, #wizard');
		
		jQuery('#switch select').change(function() {
			accordions.accordion("activate", this.selectedIndex-1 );
		});
		jQuery('#close').click(function() {
			accordions.accordion("activate", -1);
		});
		jQuery('#switch2').change(function() {
			accordions.accordion("activate", this.value);
		});
		jQuery('#enable').click(function() {
			accordions.accordion("enable");
		});
		jQuery('#disable').click(function() {
			accordions.accordion("disable");
		});
		jQuery('#remove').click(function() {
			accordions.accordion("destroy");
			wizardButtons.unbind("click");
		});
	});
</script>
A HTML pedig igy szol a 2. es 3. tab alatt:
<div class="box">
<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>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/>
				</p>
			</div>
		</div>	
		</div>
		<div class="box">
			<div class="basic" style="float:left;"  id="list1a">
			<a>There</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>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</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/>
				</p>
			</div>
		</div>	
        </div>
Latjatok, a masodik class box alatt is ua. van mint az elsonel...akkor miert nem mukodik?
Elkepzelheto, hogy valamelyik kulso js-ben kell a hiba forrasa utan nezni? Ha igen..valaki segitene?

Koszonom.
 
1

id

duplabe · 2008. Már. 29. (Szo), 14.30
mert mindkét listának ugyanaz az id-ja. azt id egyedi azonosításra való, ha két elemnek ugyanaz, megzavarja a dolgokat. a masodik listanak list1b-nek kell lennie, mert úgy adtad meg a javascriptben.
2

nem az a gond szerintem...

numen · 2008. Már. 29. (Szo), 15.07
a linkelt oldalon már más kód van, benne ezzel:
<div class="basic2" style="float:left;  id="list1b"">
rakd át a végéről az idézőjelet a jobbik helyre:D
3

koszonom

elba · 2008. Ápr. 6. (V), 00.41
nagyon egyszeru volt: list1a, list1b.
koszi