• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Using 2 javascript tools (accordion and a slider) break when put on same page.

dalearyous

Senior member
Code:
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/easySlider1.7.js"></script>
<script type="text/javascript" src="acc/mootools-core-1.4.3-compat.js"></script>
<script type="text/javascript" src="acc/mootools-more-1.4.0.1-compat.js"></script>
<script type="text/javascript">
	$(document).ready(function(){	
		$("#slider").easySlider({
			auto: true, 
			continuous: true
		});
	});	
</script>
<script type='text/javascript'>//<![CDATA[ 
window.addEvent('domready', function(){
    new Fx.Accordion($('accordion'), '#accordion h2', '#accordion .content');
});
//]]>  
</script>

any idea why and how i can fix this? if i separate them both (put 1 on one html page and 1 on another for testing) they both work just fine
 
When you put them on separate pages for testing are you also removing the unnecessary external script references? I'm just wondering if the scripts aren't colliding with each other somehow. You might also try putting the slider into the 'domready' event, or the accordion into the 'document.ready' event, so that you only have one event firing when the dom is built.
 
Also using 2 JavaScript libraries (Query and mootools9 might nto be the best idea too. Just asking for problems. decide on one and then choose the according widgets for that library.
 
When you put them on separate pages for testing are you also removing the unnecessary external script references? I'm just wondering if the scripts aren't colliding with each other somehow. You might also try putting the slider into the 'domready' event, or the accordion into the 'document.ready' event, so that you only have one event firing when the dom is built.

Mootools and jQuery definitely are colliding. They both try and use $ which just isn't going to work. To fix you can either google how to use jQuery.noconflict() or switch all your references to $ in your jQuery plugin and the specific stuff inside your <script> tag that calls the jQuery plugin (NOT the actual jQuery file) to jQuery instead of $.

I was going to post this the other day, but it made even less sense then when I wrote something similar. I was really hoping someone would step up.
 
Last edited:
Back
Top