From: Martin <warwo...@gmail.com>
Date: Sun, 5 Oct 2008 22:55:01 -0700 (PDT)
Local: Mon, Oct 6 2008 1:55 am
Subject: Re: Multiple sidebars?
Hi Daniel.
I think the main problem with my previously posted code was that the
Here's a more refined approach.
Again the code is untested - i tried getting your page to load on my
function makeSidebar() {
}
for(i in categoryHTML){
} // check that i is a property (mycategory) that we've created and not a built in property or method of the javascript Object if(i.substr(0, 4)==='cat_'){ // remove 'cat_' from the category property name i=i.substr(4, i.length-4); // assign the category html to sidebar container with id that is same as category document.getElementById(i).innerHtml=categoryHTML[i]; }
And then within your HTML create the containers to hold the sidebar
} } for each category: <div class="side-bar" id="theatre"></div>
Don't forget - you need to create a sidebar container for each and
document.getElementById(i).innerHtml=categoryHTML[i];
will likely cause an error 'i is undefined'.
Martin.
On 6 Oct, 02:38, daniel <dajohnso...@gmail.com> wrote:
> Martin, I added the suggested code. But the only difference i am
> noticing is the "undefined" before the first entry from the array. > I would think that I would need to have several "sidebar" class
> Is this reasonable?
> On Oct 5, 6:20 pm, Martin <warwo...@gmail.com> wrote:
> > Try something like this (it's untested btw!):
> > function makeSidebar() {
> > for (i in categoryHtml){
> > document.getElementById("side_bar").innerHTML = html;
> > }
> > Martin.
> > On 5 Oct, 07:30, daniel <dajohnso...@gmail.com> wrote:
> > > I have a request from my boss to break up my current 1 sidebar into
> > > my map is very similar tohttp://www.osu.edu/map/google.php(asfaras
> > > I saw this:http://wolfpil.googlepages.com/toggle-cats.html
> > > and it seems close, but I my knowledge of javascript isn't developed
> > > Any help would be much appreciated. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||