Reputation: 7866
I'm trying to get Jquery accordion working but I can't seem to.
Here is the code
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>accordion demo</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
</head>
<body>
<div id="accordion">
<h3>Read More</h3>
<div>
<p>Whether you choose to create a healthier lifestyle, deeper relationships, or seek more fulfillment in your career, TeamUp will take you there.</p>
<p>You’ll discover your <b>patterns of behavior</b> and consciously choose which ones to keep and which ones to change. You'll experience your life from a new and refreshing perspective.</p>
</div>
</div>
<script>
$( "#accordion" ).accordion();
</script>
</body>
Here is what I'm doing on JSFiddle
Any help appreciated
Thanks
Upvotes: 0
Views: 321
Reputation: 2007
It works fine if you:
Set collapsible: true
in the accordion params (by default, accordions always keep one section open)
$( "#accordion" ).accordion({ collapsible: true });
Upvotes: 0
Reputation: 3867
Looks like the problem is with your fiddle only. I pasted your entire code in jsfiddle and it looks to be working.
Same code pasted in your question
http://jsfiddle.net/sajith/VQ6z2/
Upvotes: 0
Reputation: 388436
The only problem I could see is the use relative protocol, it wouldn't work if the file is loaded from local file system
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
Your jsfiddle has problem because it looks like jsfiddle is not including the jQuery-ui.js file
Upvotes: 1