<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($) {
// Code for accordion here.
});
// Code for twitter here.
</script>
It works like this but is there any way I can see the source - have you got an url you can share? Then we could work out better where to place the relevant code...
******UPDATE******
I'm updating here as this post is getting a bit messy, what with chat not working etc. So, in an effort to 'contain' the info..
There's no $(document).ready(function(){})
in the <head>
you posted to jsfiddle, so you could try to call the twitter widget from...
<body onload="new TWTR.Widget({}).render().setUser('Sometwitterpage').start();">
it may be better to write a function that you can call from onload and that function contains the call for new twitter widget.
onload will only fire once everything has been loaded, all images etc. so your accordion should already be working and then afterwards you can call the twitter widget. Presumably the user would then see the twitter widget 'appear' as an added element to the page however.
info re onload="myFunc()"
and the differences compared to $(document).ready()
here...
Difference between onload() and $.ready?
see how it goes - if not, we'll think of something else.
S
******UPDATE 2******
Ok, so if you don't have access to the <body>
tag try this:
in the block with accordion:
<div id="accordion">
<h3><a href="#">First header</a></h3>
<div>First content</div>
<h3><a href="#">Second header</a></h3>
<div>Second content</div>
</div>
<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($) {
// Code for accordion here eg...
$('.accordion .head').click(function() {
$(this).next().toggle('slow');
return false;
}).next().hide();
});
</script>
and then in the block with the twitter widget:
<script type="text/javascript">
//your original twitter widget code
new TWTR.Widget({
version: 2,
type: 'profile',
rpp: 4,
interval: 30000,
width: 250,
height: 350,
theme: {
shell: {
background: '#5785BC',
color: '#eff4fa',
},
tweets: {
background: '#ffffff',
color: '#424242',
links: '#2480bd'
}
},
features: {
scrollbar: false,
loop: false,
live: false,
behavior: 'all'
}
}).render().setUser('Sometwitterpage').start();
</script>
See how that goes...
****UPDATE 3****
In the <head>
you posted on jsfiddle there was the following includes:
<script type="text/javascript" src="http://www.somewebsite.com/scripts/jquery/jquery-ui-1.8.19.custom.min.js?m=20120904100316"></script>
<script type="text/javascript" src="http://www.somewebsite.com/scripts/jquery/jquery.prosteps.js?m=20120904100316"></script>
<script type="text/javascript" src="http://www.somewebsite.com/scripts/jquery/jquery.boxy.js?m=20120904100316"></script>
<script type="text/javascript" src="http://www.somewebsite.com/scripts/jquery/jquery.scroll-To.js?m=20120904100316"></script>
<script type="text/javascript" src="http://www.somewebsite.com/scripts/jquery/jquery.hoverIntent.js?m=20120904100316"></script>
<script type="text/javascript" src="http://www.somewebsite.com/scripts/jquery/jquery.jqzoom1.0.1.js?m=20120904100316"></script>
<script type="text/javascript" src="http://www.somewebsite.com/scripts/jquery/jquery.tools.scrollable.min.js?m=20120904100316">
Do you have the option of turning these features on/off - for example if you're not going to use a jquery tools scrollable, turn it off - i.e., don't include the source .js file. My guess is there's a very, very strong chance the problem is coming from conflicting variables so you could try to isolate it by turning off/on the various scripts. Getting rid of surplus is a definite starting point.