Nov 032013
 
 Posted by on 03/11/2013 How-To's Tagged with: , , , , , ,  1 Response »

An example of usage of jQuery plugins with Suffusion as it was presented in the post about Adding jQuery.

For obtaining the accordion from our What we did page I used the collapsible version of jQuery-UI Accordion widget.

If you go on jQuery-UI page (linked above) and press View Source link will see the code for an HTML page which contain all informations needed for making accordions to works. First, we can see in   section this code:

In this case we can use directly the links provided by jQuery-UI page – we don’t need to download anything. The required links are contained in Quick Access section at the bottom of the page:

Quick Access section on jQuery-UI page
Quick Access section on jQuery-UI page

So, at  Suffusion Options -> Back-end -> Custom Includes -> First Additional Stylesheet link we add the path to the main stylesheet file: https://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css

– at Suffusion Options -> Back-end -> Custom Includes -> First External Javascript file I added the path to the main js file: https://code.jquery.com/ui/1.10.3/jquery-ui.js (You don’t forget – we don’t need the link to the jQuery library)

– The <script>  tag contained in the html code from the jQuery-UI site is the trigger function for accordions. We will add the code in noConflict mode at Suffusion Options -> Backend -> Custom Includes -> Custom Header Javascript:

 Done. From now we can present our content in accordion style on any page where will wrap  our content in a div with the id “accordion”. The tab titles are formed by the content of <h3>  tags:

That’s it, you have the content showed in a nice accordion style. Of course, in the same way can add tabs, dialogs, buttons, sliders… anything you wish.

Changing Suffusion for WordPress 3.6.

Changing Suffusion for WordPress 3.6.

If you upgrade WordPress to version 3.6. will notice that Suffusion cannot save anymore the changes in options. This is because the new version of jQuery UI used in this update (1.10.3) don’t have anymore the “select” method for tabs, and this method was used in backend of Suffusion for Save/Reset button tabs.

Continue reading...