Jump to content

Does collapsible text require a time delay if the hidden text is very lengthy?

RPGHouseFabricator's Photo
Posted Jul 02 2011 06:45 AM
6299 Views

On page 450 of Creating a Website, the missing manual, by Matthew MacDonald, there is a section on Collapsible Text. I am using the sample script given on page 451 as my base. I have multiple collapsed texts on a page, but one of them is not hiding itself when the web page is opened. If you click on it, it functions normally, like all the other collapsible texts though. Only when the page starts, it is not hiding itself like the others. The text inside the failing collapsible section is very lengthy. My question is how can I get the text to collapse at the open of the page? Does it need some sort of Javascript time delay that allows time to hide it? How can I accomplish this?

Thanks, Mark

Attached File  CollapsibleText.htm (1.88K)
Number of downloads: 387Attached ImageAttached Image

2 Replies

0
  RPGHouseFabricator's Photo
Posted Jul 03 2011 05:05 PM

The attachment above is the base I used for collapsing the text. Attached here is the actual file in question. I have 5 sections that are intended to hide their text content until they are clicked on. All 5 sections use the same function. Why is section 5 "General Fabrication Guidelines" not hiding itself when the page is opened, yet the other 4 sections are?Attached File  marksnewsite.html (22.95K)
Number of downloads: 489
0
  RPGHouseFabricator's Photo
Posted Jul 04 2011 12:37 PM

OK, I finally figured out a solution that works. I assumed that since all five sections used the same markup and function, and the 5th one was not working properly, that the function can only handle a small number of commands using it at once. In my case it was 4.

I duplicated the function, renamed it, and attached the 5th section to it instead. It worked.

This makes me wonder if every IS, OS, browser...etc will respond differently to how many commands choose to use the same function at the same time. I am using IE8 with XP, and the function I was using maxed itself out at 4. I guess to be on the safe side, one might want to create a separate duplicate function for each collapsible section. I don't know though. This is actually my first attempt at building a web page. If it was not for Matthew MacDonalds excellent book, I would not have ventured into creating a website. It transformed me from tard to geek in 3 weekends, and is responsible for 98% of what I know.

I noticed a handfull of people who have also attempted to resolve this, without leaving a reply or solution. Thanks for the effort, I appreciate the time you took to check it out.