How do I load this jquery accordion into a div?
Hi,
I have a jquery accordion that works fine on its own. When I try to load it into a div located on my home page using a link and the load method, the accordion appears as a list with headings and loses all its functionality.
My working accordion can be found in
http://jsfiddle.net/jenova007/jhhpovzb/
I would like to load this accordion into the "result" div when I click on the "Store Locations" link. After making many attempts I end up loading the original accordion page or loading a list of accordion headings and list items but not the working accordion in the div.
After reading a couple of articles on reinitialising the accordion on load etc, I am still lost. Could someone please explain how I can go about doing that in my javascript? Thank you.
- <html>
<head>
<title>Store_Locations</title>
<style type="text/css">
#result {position: absolute;
top: 30%;
left: 0;}
</style>
</head>
<body>
<a href="StoreListA.html">Store Locations</a>
<div id="result">
</div>
<script src="loader.js"></script>
</body>
</html>
- <script type="text/javascript">
$('a').click(function() {
var page = $(this).attr('href');
$('#result').load(page);
return false;
});
</script>