The place for more technical questions for those who want to create new pagetypes or bespoke functionality.

jQuery Accordion

  • Neil Pollock
  • Auteur du sujet
  • Hors Ligne
  • Membre premium
  • Membre premium
Plus d'informations
il y a 9 ans 5 mois #4290 par Neil Pollock
jQuery Accordion a été créé par Neil Pollock
In the XOT template you have the Accordion Navigator page type, which I believe uses the jQuery accordion widget . There are various jQuery options that can be set when it comes to styling, but for some reason I can't get heightStyle to work.

Essentially, I want the height of each accordion panel to fit the size of the content, rather than filling the whole page. So, this should work:
Code:
$(function() { $(".ui-accordion" ).accordion({ heightStyle: "content" }); });

Unfortunately, it doesn't.

Here is a link so you can see what I mean: xerte.cardiff.ac.uk/play_5135

Page 1 - An accordion I declared myself which works as required
Page 7 - The default settings on Accordion Navigator page
Page 8 - A failed attempt to apply my preferred style to the Accordion Navigator page

Ideally, I would like the accordion on Page 8 to function like the accordion on Page 1 (this is preferable for users who won't want to add an accordion via HTML and would be better adding it through the Xerte interface).

Any ideas?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 9 ans 5 mois #4291 par tom
Réponse de tom sur le sujet jQuery Accordion
The height of the content is also hardcoded so you need to overrule that as well:

This worked for me:
Code:
$(function() { $(".ui-accordion" ).accordion({ heightStyle: "content" }); $(".ui-accordion-content" ).css('height', 'auto'); });
Les utilisateur(s) suivant ont remercié: Neil Pollock

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 9 ans 5 mois #4335 par Fay
Réponse de Fay sur le sujet jQuery Accordion
I've just added new 'panel height' optional properties to the accordion & tabbed navigator pages that will control this

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: JohnSmith
Temps de génération de la page : 0.127 secondes
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo