473,320 Members | 2,054 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Expand Div Problem

200 100+
Good day, I'm having difficulty to show the obbjects within the Div/Span

I'm trying to create an expand & minimize effect (like tree structure) with + to expand and "-" being expanded

Well the below works the second time around. When page Loads the "+" shows to expand but shows all the objects as it is expanded.

But when i click on the expand icon then it works with the objects not visible & icon still being "+" and then works like it surpose to, because when i click i get the "-" expanded with objects showing below.

Please help
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT TYPE='text/javascript'>
  2. function toggleHistN(srcElement, srcArrow)
  3.  {
  4.     if (srcElement.style.display == 'none')
  5.     {
  6.         srcElement.style.display = '';
  7.         srcArrow.src = 'images/expand.gif';
  8.    } 
  9.    else
  10.    {
  11.         srcElement.style.display = 'none';
  12.         srcArrow.src = 'images/collapse.gif';
  13.    }
  14. }
  15. </SCRIPT>
  16. <span id='fcHistMainN' onclick='toggleHistN(fcHistN, fcExpandN)'>
  17.    <span>
  18.      <img src='images/collapse.gif' id='fcExpandN' align="middle" /> App Form
  19.    </span>
  20. </span>
  21. <tr>
  22.   <td>
  23.     <div id='fcHistN'>
  24.          <table>
  25.  
  26.  
Jan 21 '10 #1
2 1754
Rather than set the display value to nothing if it's visible, you should probably set it to something like block or inline. Not sure if that's the answer, though!

Also some browsers may whinge that you're passing ID values directly as variables/objects, when you should be using document.getElementById.
Jan 21 '10 #2
ismailc
200 100+
Thank You :)

The div was missing: style="display: none;
Jan 22 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Piet | last post by:
Hi there. I have a problem when working with a wxTreeCtrl. I would like to expand all branches of a sepcific position in a tree with a single command. Since there does not appear to be such a...
8
by: 2centbob | last post by:
Has anyone had an issue with SQL Server not being able to expand against a RAID 5 file system? My current configuration is that the server is started and stopped using the local system account. I...
7
by: peter | last post by:
I use the click-to-expand menu at http://javascript.internet.com/navigation/click-to-expand-menu.html This works fine, but is there a way to expand or collapse all the menus? An example of how...
1
by: Steven | last post by:
Hello, I have a problem in using TreeView. I want to know how the TreeView can automatically Expand a path I have accessed before? I have tried to use "path.Expand()", but it seems no good...
4
by: Karim El Jed | last post by:
Hi, I'm trying to expand a special Node of my TreeView from Codebehind. I have a TreeView on a page for navigating to another site. On the other tsite here is the same TreeView more precisely a...
7
by: Benzi Eilon | last post by:
I am executing an Expand command in order to expand a CAB file. This is done by calling CreateProcess with the Expand command and then WaitForSingleObject and checking the process exit code. My C++...
1
by: pemigh | last post by:
In a prior posting (too old to reply directly), Jim Devenish described exactly what my client has seen, both in terms of AutoExpand behaving oddly and the way that caps lock relates to the...
1
by: jrs362 | last post by:
One more problem... I need to write a method(Which i'm calling "expand") that takes an int array as one of its parameters and returns a new int array that is 5 elements longer. The contents of the...
11
by: Nospam | last post by:
I don't know what it is I am doing wrong, I am trying to get the menus to either expand or contract based on their previous states, i.e if already expanded if clicked again contract, and if...
15
by: raknin | last post by:
Hi, I am new to the javascript and the ajax. I want to create a text and expand and collapsonly part of it . Something similar to what is done in youtube., I have this code. <!DOCTYPE HTML...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.