Accordion with YQL
by basmaat
HTML
<script src="http://www.designchemical.com/lab/wp-content/themes/dclab/js/jquery.cookie.js"></script>
<script src="http://www.designchemical.com/lab/wp-content/themes/dclab/js/jquery.hoverIntent.minified.js"></script>
<script src="http://www.designchemical.com/lab/wp-content/themes/dclab/js/jquery.dcjqaccordion.2.6.min.js"></script>
<link rel="stylesheet" href="http://www.designchemical.com/lab/wp-content/themes/dclab/css/dcaq-menu/skins/graphite.css">
<div class="graphite demo-container">
<ul class="accordion" id="accordion-1">
</ul>
</div>
CSS
/* Page */
body,html,div,blockquote,img,label,p,h1,h2,h3,h4,h5,h6,pre,ul,ol,li,dl,dt,dd,form,a,fieldset,input,th,td{border:0;outline:none;margin:0;padding:0;}
ul, ul li{list-style: none;}
ul.text {margin-bottom: 1em; line-height: 1.5em;}
.text-center {text-align: center;}
body {font: normal 13px Arial, sans-serif;}
h2 {font: normal 26px Arial, sans-serif; padding: 20px 0; margin: 0 0 30px 0;}
.wrap {width: 960px; margin: 0 auto;}
.demo-container {padding: 20px; float: left; width: 260px;}
.demo-container h4 {font-size: 14px; margin: 0 0 5px 0;}
.clear {clear: both;}
.dcjq-count {float: right;}
JavaScript
jQuery(document).ready(function($) {
var testURL = 'http://query.yahooapis.com/v1/public/yql/basmaat/test2';
var sheet = 'https://spreadsheets.google.com/feeds/list/0AkSDPC69_vxUdGZXblZ6TWY4dHZELWI0Zl9QZDBOclE/od6/public/values?alt=json';
console.log(sheet);
// var googleJSON = $.getJSON(sheet);
// console.log(googleJSON.feed.entry);
console.log('test');
$.getJSON(sheet,function(msg){
console.log(msg.feed.entry[0].gsx$_cn6ca.$t);
// Appending the definition list:
var tree = msg.feed.entry[0].gsx$_cn6ca.$t;
console.log(tree);
$('#accordion-1').append(tree);
});
jQuery('#accordion-1').dcAccordion({
eventType: 'click',
autoClose: true,
saveState: true,
disableLink: true,
speed: 'slow'
});
});