Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4022698
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:30:29+00:00 2026-05-20T10:30:29+00:00

I am attempting to build a UI such that a JQuery Accordion is contained

  • 0

I am attempting to build a UI such that a JQuery Accordion is contained within a scrolling div. This works fine under FF and IE8 but is a complete travesty on IE7. Specifically: whenever you scroll up or down, the entire accordion doesn’t slide up and down properly (parts of it scroll, but other parts do not) and parts of the accordion extend outside of the div. Clicking on some of the accordion header results in a javascript error deep in JQuery.

Here is code that exhibits this issue (pardon its inelegance, as I have reduced it down from the full UI code in my application):

JavaScript Code:

var contDiv = 'foobar'
var accordionId = 'my_accordion'

contDiv.html(    "<div id='" + accordionId + "'>" +
                    "<h3><a href='#'>First Section</a></h3>" +
                    "<div><p>foo<br>bar<br>baz<br>qux</p></div>" +
                    "<h3><a href='#'>Second Section</a></h3>" +
                    "<div><p>foo<br>bar<br>baz<br>qux</p></div>" +
                    "<h3><a href='#'>Third Section</a></h3>" +
                    "<div><p>foo<br>bar<br>baz<br>qux</p></div>" +
                    "<h3><a href='#'>Fourth Section</a></h3>" +
                    "<div><p>foo<br>bar<br>baz<br>qux</p></div>" +
                  "</div>");

var accordionDiv = $('#' + accordionId);
accordionDiv.accordion({autoHeight: false});

HTML:

<div style="height:100px;overflow:auto;"><div id="foobar"></div></div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:30:29+00:00Added an answer on May 20, 2026 at 10:30 am

    Ok, I don’t have IE7 to test this, but I think the main problem is the overflow:auto. Try this style for your HTML

    <div style="height:100px; overflow-x:hidden; overflow-y:auto; position:relative; left:0; top: 0;">
     <div id="foobar" style="width:98%"></div>
    </div>
    

    Another problem (and I’m guess it’s just a typo in the code above since you said it worked in other browsers is that contDiv need to be a jQuery object:

    var contDiv = $('#foobar');
    

    Update: Ok, IE does need the position:relative to work properly. I updated the HTML above with left:0;top:0; as well, I remember IE didn’t set those positions, but I can’t find the reference. Additionally, I set the width of foobar to 98% because IE does not adjust to the width of the scroll bar. Here is a demo of what I have done so far.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to build a method call from strings that have been passed into
I am attempting to build a backup script that moves a tar file from
I'm attempting to build some C++ code that requires the Windows 7.0 SDK header
I'm attempting to build mercurial 1.3.1. I've attempted this thus far on my Mac
I am attempting to build a Ruby Gem following this tutorial, however I am
I am attempting to build a Java program that stores food recipes for myself.
Attempting to build a C# NPAPI plugin I have found a tutorial which describes
Attempting to build a C# project which has numerous references to assemblies in NuGet
I'm attempting to build a JSF/Hibernate application using Java 7 and Tomcat 7. I
I'm attempting to build an app using the Sencha Touch 2 builder tools. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.