Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I would like to add Jquery Accordion code for Sharepoint 2010. I have added jquery-1.9.1.js & jquery-ui.js file in _layouts\JScript folder. Now I want to add below code sharepoint designer. Please help where I can add this.

<div id="accordion">
<h3>Heading 1</h3>
<div class="accordion-content">
    <p>jQuery UI 1.10 includes dozens of bug fixes and improved accessibility. In addition, the dialog and progressbar widgets have undergone '</p>

share|improve this question
    
Is this in a master page, page layout or something else? Where are you including the actually jQuery includes? What kind of problem are you seeing that is preventing you from doing this? –  Dave Wise Mar 21 '13 at 16:38
    
I have added JQuery files in .....\14\TEMPLATE\LAYOUTS\Jscript folder(custom folder). Then I added scriptlink _layouts/CustomJScripts/jquery-1.9.1.js. in Sharepoint designer for default loading. Then i added above Accordion code in Sharepoint designer but it didn't work. –  user2054069 Mar 21 '13 at 17:26
    
<script> $(function() { $( "#accordion" ).accordion(); }); <script> This code also I added in sharepoint designer. –  user2054069 Mar 21 '13 at 17:28
    
Did you check in? Publish? –  Pathachiever11 Mar 21 '13 at 17:43

2 Answers 2

Use a CustomAction element with the target of ScriptLink, or a DelegateControl targeting AdditionalPageHead.

share|improve this answer

You may need to put your accordian script into a $(document).ready(); block as it sounds like it is executing either before the jQuery scripts are loaded or before the html itself has been fully loaded into the DOM.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.