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

  • SEARCH
  • Home
  • 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 8254153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:06:05+00:00 2026-06-08T01:06:05+00:00

I would like to add dynamic content to a JQuery Accordion container. My code

  • 0

I would like to add dynamic content to a JQuery Accordion container. My code almost works, but there is a problem.

Screenshot

I cannot figure out how to get the first container to recognize the new images. It acts like there is nothing in the container. I suspect this has to do with loading the images with Javascript, but I am no expert! My guess is something’s out of order. All of the buttons still function, and the accordion acts as it should in all the other areas. I have tried setting the different parameters, such as autoheight, clearStyle, etc.. Nothing works for me. Here’s the trimmed goods:

HTML

.........

<section id="rightMenu">
    <div id="addHolder">
        <h3 class="topHeader"><a href="#">Quick Pick</a></h3>
            <ul id="quickPick"></ul>

        <h3><a href="#">Notes</a></h3>
        <div>
            <p>
             ......
            </p>
        </div>
        <h3><a href="#">Quiz</a></h3>

        <div>
            <p>
             .....
            </p>
        </div>
        <h3><a href="#">Image Options</a></h3>

        <div></div>
.........

<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery-ui-1.8.21.custom.min.js"></script>
<script src="js/modernizr.js"></script>
<script src="js/modUI.js"></script>
<script src="js/imageProvider.js"></script>
<script>
window.onload = imageProvider.initLinks;
$(document).ready(modUI.modAccord);
</script>

JS – modUI.js

var modUI = {
init: function(){
},
modAccord: function(){
    $( "#addHolder" ).accordion({
        autoHeight: true,
        navigation: true,
        clearStyle: true
    });
}
};

JS – imageProvider.js

var imageProvider = {

thisPic:0,

initLinks:function () {
    imageProvider.imageList(14, 2);
    document.getElementById("nextPic").onclick = imageProvider.processNext;
    document.getElementById("prevPic").onclick = imageProvider.processPrev;

},

   ....

multiDimensionArray:function (rows, columns) {
    var myArray = new Array(rows);
    for (var i = 0; i < rows; i++) {
        myArray[i] = new Array(columns);
        for (var j = 0; j < columns; j++) {
            myArray[i][j] = "";
        }
    }
    return (myArray);
},

  .....

imageList:function (qty, data) {
    var imageData = imageProvider.multiDimensionArray(qty, data);
    var filePath = './images/mods/angiograph/head/';
    var imgPrefix = 'Ag';
    var imageType = '.jpg';


    for (var i = 0; i < qty; i++) {
        imageData[i][1] = filePath + imgPrefix + (i + 1) + imageType;
    }

   for (var j = 0; j<imageData.length; j++){
            $("<li>", { html:'<img src="' + imageData[j][1] + '" width="75" height="75"/>'}).appendTo("#quickPick");
    }

}
 };

CSS

#mainSection #rightMenu {
position: absolute;
width: 15%;
height: 90%;
left:65%;
top: 5%;
background-color: #d3cbbd;

-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;

-webkit-box-shadow: 0px 0px 15px rgba(0, 0, 0, .75);
-moz-box-shadow: 0px 0px 15px rgba(0, 0, 0, .75);
box-shadow: 0px 0px 15px rgba(0, 0, 0, .75);
}

#mainSection #imageHolder img{
position: absolute;
width: 63%;
height: 70%;
left: 15%;
top: 15%;
}

#mainSection #rightMenu #addHolder{
position: absolute;
width: 100%;
height: 100%;
left:0;
top: 0;
}

#mainSection #rightMenu #addHolder h3.topHeader {

position: relative;
top: -1px;
-webkit-border-radius: 10px;

-moz-border-radius-topleft: 10px;
-moz-border-radius-topright: 10px;

border-top-left-radius: 10px;
border-top-right-radius: 10px;
}

#mainSection #rightMenu #addHolder p{
font-size: 1.1em;
font-family: verdana, sans-serif;
}

#mainSection #rightMenu #addHolder #quickPick{
position: absolute;
list-style: none;
top: 6em;
left: .1em;
height: 30%;
}

#mainSection #rightMenu #addHolder li{
display: inline;
float: left;
margin-left: .2em;
}

.ui-accordion { width: 100%; }
.ui-accordion .ui-accordion-header {
cursor: pointer;
position: relative;
margin-top: 1px;
background-color: #456f74;

}
.ui-accordion .ui-accordion-li-fix { display: inline; }
.ui-accordion .ui-accordion-header-active {
border-bottom: 0 !important;
background-color: #eb5937;
}
.ui-accordion .ui-accordion-header a {
display: block;
font-family: verdana, sans-serif;
font-size: 1em;
padding: .65em .65em .65em 1em;
text-decoration: none;
color: #f5f5f5;

}
.ui-accordion-icons .ui-accordion-header a {
padding-left: .5em;
}
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content {
padding: 1em 1em;
border-top: 0;
margin-top: -25px;
position: relative;
top: 0;
overflow: auto;
display: inline-block;

}
  • 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-06-08T01:06:06+00:00Added an answer on June 8, 2026 at 1:06 am

    Shouldn’t <ul id="quickPick"></ul> really be <div><ul id="quickPick"></ul></div>?

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

Sidebar

Related Questions

I would like to add to an element's position a dynamic amount e.g. 40px
I would like to add a small dice-rolling effect to my Javascript code. I
I have own project and i would like add for this class same as
I have a ListView and each item have a TextView. I would like add
I would like to add a GestureDetector to all views (view groups) of an
I would like to add a custom calculation method to a managed object (which
I would like to add roots to a VirtualTreeView http://www.delphi-gems.com/index.php/controls/virtual-treeview with a thread like
I would like to add a hash into an array using Ruby version 1.8.7:
I would like to add up the number of line changes in an SVN
I would like to add a pop effect when I hover over a SVG

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.