Results 1 to 4 of 4

Thread: Spry Content Height

  1. #1
    Join Date
    Jun 2011

    Question Spry Content Height

    Hi, I am using a spry accordion on my site and I need the height of the content to change depending on how much there is in each panel of content. So that each content panel has an individual height. How can I do this?

    Here is all the default spry accordion code mixed with bits that I've added and edited.

    @charset "UTF-8";
    /* SpryAccordion.css - version 0.5 - Spry Pre-Release 1.6.1 */
    /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */
    /* This is the selector for the main Accordion container. For our default style,
     * we draw borders on the left, right, and bottom. The top border of the Accordion
     * will be rendered by the first AccordionPanelTab which never moves.
     * If you want to constrain the width of the Accordion widget, set a width on
     * the Accordion container. By default, our accordion expands horizontally to fill
     * up available space.
     * The name of the class ("Accordion") used in this selector is not necessary
     * to make the widget function. You can use any class name you want to style the
     * Accordion container.
    .Accordion {
    /* This is the selector for the AccordionPanel container which houses the
     * panel tab and a panel content area. It doesn't render visually, but we
     * make sure that it has zero margin and padding.
     * The name of the class ("AccordionPanel") used in this selector is not necessary
     * to make the widget function. You can use any class name you want to style an
     * accordion panel container.
    .AccordionPanel {
    	margin: 0px;
    	padding: 0px;
    /* This is the selector for the AccordionPanelTab. This container houses
     * the title for the panel. This is also the container that the user clicks
     * on to open a specific panel.
     * The name of the class ("AccordionPanelTab") used in this selector is not necessary
     * to make the widget function. You can use any class name you want to style an
     * accordion panel tab container.
     * NOTE:
     * This rule uses -moz-user-select and -khtml-user-select properties to prevent the
     * user from selecting the text in the AccordionPanelTab. These are proprietary browser
     * properties that only work in Mozilla based browsers (like FireFox) and KHTML based
     * browsers (like Safari), so they will not pass W3C validation. If you want your documents to
     * validate, and don't care if the user can select the text within an AccordionPanelTab,
     * you can safely remove those properties without affecting the functionality of the widget.
    .AccordionPanelTab {
    	background-color: #151515;
    	border-bottom:1px dotted #333;
    	border-top:1px dotted #333;
    	margin: 0px;
    	padding: 2px;
    	cursor: pointer;
    	-moz-user-select: none;
    	-khtml-user-select: none;
    	height: 120px;
    	font-family:Tahoma, Geneva, sans-serif;
    /* This is the selector for a Panel's Content area. It's important to note that
     * you should never put any padding on the panel's content area if you plan to
     * use the Accordions panel animations. Placing a non-zero padding on the content
     * area can cause the accordion to abruptly grow in height while the panels animate.
     * Anyone who styles an Accordion *MUST* specify a height on the Accordion Panel
     * Content container.
     * The name of the class ("AccordionPanelContent") used in this selector is not necessary
     * to make the widget function. You can use any class name you want to style an
     * accordion panel content container.
    .AccordionPanelContent {
    	overflow: auto;
    	margin: 0px;
    	padding: 0px;
    .AccordionPanelContent h1 {
    	font-family:Tahoma, Geneva, sans-serif;
    .AccordionPanelContent p {
    	font-family:Tahoma, Geneva, sans-serif;
    /* This is an example of how to change the appearance of the panel tab that is
     * currently open. The class "AccordionPanelOpen" is programatically added and removed
     * from panels as the user clicks on the tabs within the Accordion.
    .AccordionPanelOpen .AccordionPanelTab {
    	background-color: #151515;
    /* This is an example of how to change the appearance of the panel tab as the
     * mouse hovers over it. The class "AccordionPanelTabHover" is programatically added
     * and removed from panel tab containers as the mouse enters and exits the tab container.
    .AccordionPanelTabHover {
    	color: #FFDD22;
    /* This is an example of how to change the appearance of all the panel tabs when the
     * Accordion has focus. The "AccordionFocused" class is programatically added and removed
     * whenever the Accordion gains or loses keyboard focus.
    .AccordionFocused .AccordionPanelTab {
    	background-color: #151515;
    /* This is an example of how to change the appearance of the panel tab that is
     * currently open when the Accordion has focus.
    .AccordionFocused .AccordionPanelOpen .AccordionPanelTab {
    	background-color: #151515;
    /* Rules for Printing */
    @media print {
      .Accordion {
      overflow: visible !important;
      .AccordionPanelContent {
      display: block !important;
      overflow: visible !important;
      height: auto !important;

    and the accordion html code

    <div id="Accordion1" class="Accordion" tabindex="0">
      <div class="AccordionPanel">
        <div class="AccordionPanelTab">Home</div>
        <div class="AccordionPanelContent" id="home">
        <h1>Your Title</h1>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi fermentum fermentum leo, vitae pharetra lacus tempus in. Fusce id enim quam. Nulla convallis vestibulum sollicitudin. Aenean enim nisi, mollis vel eleifend in, pulvinar eget ligula. Duis commodo egestas congue. Aenean non est lectus, a luctus libero. Sed sed lectus a est varius ultricies. Aenean purus nunc, dictum vel hendrerit vitae, lobortis congue eros. Etiam pretium massa vitae odio rutrum nec eleifend lacus lobortis. Quisque cursus porttitor feugiat. Vivamus dignissim tellus eu velit consectetur mattis. Quisque pulvinar iaculis libero, at eleifend libero cursus sed. Morbi odio elit, volutpat vitae suscipit in, vehicula quis urna. Morbi sed placerat lacus. Donec rhoncus est in odio auctor quis pretium nibh scelerisque. Vestibulum arcu lectus, tincidunt et mollis vitae, aliquet non diam. Maecenas consectetur nulla sed risus dapibus ultricies. Morbi ultrices mauris in magna mollis iaculis. Nam lorem ipsum, vulputate ut rutrum at, tristique non metus.
    <br />
    <br />
    Aenean eu aliquam nunc. *** sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean commodo, odio sit amet eleifend scelerisque, nisi mi gravida augue, ac commodo dolor eros non nibh. Aliquam mattis erat volutpat ipsum iaculis condimentum. Nunc venenatis odio vitae elit lobortis nec ullamcorper orci aliquam. Sed viverra lacus vulputate arcu viverra a ornare ipsum dignissim. Duis feugiat elementum enim, et fringilla turpis tempor et. Ut elementum, mi quis sagittis laoreet, eros nisi eleifend libero, non placerat ligula est ac arcu. Nunc sagittis porttitor euismod. Etiam eget lorem sed ante bibendum convallis. Quisque accumsan interdum nibh a tristique. Nunc tortor magna, ornare sed sodales ac, tempus a sem. Cras dignissim sodales magna, quis sodales nibh venenatis ut. Cras at sollicitudin lectus. 
      <div class="AccordionPanel">
        <div class="AccordionPanelTab">About</div>
        <div class="AccordionPanelContent" id="about">Content 2</div>
        <div class="AccordionPanel">
        <div class="AccordionPanelTab">Gallery</div>
        <div class="AccordionPanelContent" id="gallery">Content 3</div>
        <div class="AccordionPanel">
        <div class="AccordionPanelTab">Videos</div>
        <div class="AccordionPanelContent" id="videos">Content 4</div>
        <div class="AccordionPanel">
        <div class="AccordionPanelTab">Contact</div>
        <div class="AccordionPanelContent" id="contact">Content 5</div>
    <script type="text/javascript">
    var Accordion1 = new Spry.Widget.Accordion("Accordion1");
    Please say if your need to see the javascript file too.


  2. #2
    Join Date
    Jul 2006
    So basically all the content should fit within the DIV with no extra space?

  3. #3
    Join Date
    Jun 2011


    Yes that is what I mean. I tried doing
    on the css rule for the content but that just made all the content panels the same height as the tallest one.


  4. #4
    Join Date
    Jul 2006
    You're applying the auto height to "@media print", try applying it globally. I didn't have the issue you described by testing out your code on my site, though. "auto" is default, however, so you're likely having a different issue.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.10131 seconds
  • Memory Usage 2,876KB
  • Queries Executed 13 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (4)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (71):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates