G
garey
Hello -
I have written a small table of contents manager. If an entry has
sub-entries, it has a plus in front of it. If the user clicks on the
plus, the sub-entries are displayed. The table of contents is
displayed in one frame and the pages of the document in the other.
Clicking on a table of contents entry redraws the image in the page
frame.
In order to implement this I have the following structure
<div>
<div id="anch0" class="level0">
<span id="exp0" class="plus" onClick="exp_col('exp0');"
onMouseOver="this.style.cursor = 'pointer';">+</span>
<a href="link?TOCCHOICE=0" target="RIGHT_FRAME"></a>
<div class="expandable">
<div id="anch1" class="level1">
<span id="exp1" class="plus" onClick="exp_col('exp1');"
onMouseOver="this.style.cursor = 'pointer';">+</span>
<a href="link?TOCCHOICE=1" target="RIGHT_FRAME"></a>
<div class="expandable">
<div id="anch2" class="level2"><a href="link?TOCCHOICE=2"
target="RIGHT_FRAME"></a></div>
<div id="anch3" class="level2">
<a href="link?TOCCHOICE=3" target="RIGHT_FRAME"></a></div>
....
(I've substituted the word 'link' for the actual links used in the
app, and I've taken out the a tag contents.).
If the span contains a plus, the exp_col function just looks at
the children of the span's parent, finds the expandable one, and sets
its display style to 'block'. It also sets the spans content and class
to 'minus'. Clicking on a minus reverses the process.
My problem is that the first time that I click on a span tag,
nothing happens. If I click again, everything works as advertised. The
first click continues to work until the page is refreshed.
Any ideas what's happening?
Garey Mills
I have written a small table of contents manager. If an entry has
sub-entries, it has a plus in front of it. If the user clicks on the
plus, the sub-entries are displayed. The table of contents is
displayed in one frame and the pages of the document in the other.
Clicking on a table of contents entry redraws the image in the page
frame.
In order to implement this I have the following structure
<div>
<div id="anch0" class="level0">
<span id="exp0" class="plus" onClick="exp_col('exp0');"
onMouseOver="this.style.cursor = 'pointer';">+</span>
<a href="link?TOCCHOICE=0" target="RIGHT_FRAME"></a>
<div class="expandable">
<div id="anch1" class="level1">
<span id="exp1" class="plus" onClick="exp_col('exp1');"
onMouseOver="this.style.cursor = 'pointer';">+</span>
<a href="link?TOCCHOICE=1" target="RIGHT_FRAME"></a>
<div class="expandable">
<div id="anch2" class="level2"><a href="link?TOCCHOICE=2"
target="RIGHT_FRAME"></a></div>
<div id="anch3" class="level2">
<a href="link?TOCCHOICE=3" target="RIGHT_FRAME"></a></div>
....
(I've substituted the word 'link' for the actual links used in the
app, and I've taken out the a tag contents.).
If the span contains a plus, the exp_col function just looks at
the children of the span's parent, finds the expandable one, and sets
its display style to 'block'. It also sets the spans content and class
to 'minus'. Clicking on a minus reverses the process.
My problem is that the first time that I click on a span tag,
nothing happens. If I click again, everything works as advertised. The
first click continues to work until the page is refreshed.
Any ideas what's happening?
Garey Mills