Block becomes inaccessible when made visible with javascript

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

In IE 6.0, I have a block that I hide/show with the CSS visibility
attribute.  I have a button to toggle whether it is hidden or visible,
using the onClick event.  When I hide the block and then make it
visible again, the links no longer work, the links/text/images can't be
selected, the mouse remains a pointer even when over a link, and you
can't right-click on an image to save it or view its properties.  This
works just fine in Firefox though.

Here's an example that has this effect:

        <script language="javascript">
                function toggleShow(me, id)
                        elem = document.getElementById(id);
                        if ( == "hidden")
//show content
                       = "visible";
                       = "static";
                                me.src = "arrow_show.gif";
                                me.alt = "Hide Content";
                        else    //hide content
                       = "hidden";
                       = "absolute";
                                me.src = "arrow_hide.gif";
                                me.alt = "Show Content";
                        return true;
        // -->
        <table width="300" border="1">
                                <img src="arrow_show.gif"
alt="Hide Content">
                                <b>The Title</b>
                <tr id="theItems" style="visibility:visible;
                                <a href="#">This is a link.</a><br>
                                This is some text.<br>
                                Here is an image with a link:
                                <a href="sun.jpg" target="_blank"><img
                                 src="sun.jpg" style="width:50px;"></a>


Re: Block becomes inaccessible when made visible with javascript

Wizard04 scribed:

Quoted text here. Click to load it

How about a little simplification?

<script type="text/javascript">
function toggle(what,id) {
    target = document.getElementById(id); = (what.checked)?'visible':'hidden';

Ed Jay (remove 'M' to respond by email)

Re: Block becomes inaccessible when made visible with javascript

Thanks Ed, that took out some of the "variables".  I found that the
problem was with hiding/showing a table element - I put the content in
a span instead, and it works!

Site Timeline