手风琴在IE6中搞砸了

时间:2012-01-02 00:54:46

标签: javascript html internet-explorer-6

有人可以帮我弄清楚为什么http://www.mincovlaw.com/services/copyright的手风琴剧本会在IE6中搞砸了吗?

与更现代的浏览器不同,如果我点击“作品是否受版权保护”,“作品的特定用途是否需要许可”,它会触发两个onclick事件......

我认为这与<li>内的<ul>上的onclick有关,但我不知道如何解决这个问题。

任何帮助都非常感激。

编辑:代码:

<script>
    function treatlink(e) {
        if (!e)
              e = window.event;

            if (e.cancelBubble)
              e.cancelBubble = true;
            else
              e.stopPropagation();
    }

    function togglemore(z) {
        y=document.getElementById(z);
        w=document.getElementById('img'+z);
        if (y.style.display=="none") { 
            y.style.display="block"; 
            w.src='/images/icons/closemore1.png'
        } else { 
            y.style.display="none"; 
            w.src='/images/icons/openmore1.png'
        }
    }


</script>

    <ul class="dash">

        <li class='dash' onclick='togglemore("service_a"); return false;'>Legal opinions as to:
            <a href='#' onclick='return false;'><img id='imgservice_a' src='/images/icons/openmore1.png' style='vertical-align:text-top; padding-left:8px; border:0px; padding-right:5px; position:relative; top:7px;' title='Read More' alt='Read More'></a>
            <div id='service_a' style='display:none; width:600px;margin-left:50px;padding:6px;border:1px dotted #bbbbbb;'>Legal opinions may be provided in writing or as part of face-to-face, telephone or skype consultations.</div>
        </li>

        <ul class="dash">

        <li class='checkmark' onclick='togglemore("service01"); return false;'>whether a work is protected by copyright;
            <a href='#' onclick='return false;'><img id='imgservice01' src='/images/icons/openmore1.png' style='vertical-align:text-top; padding-left:8px; border:0px; padding-right:5px; position:relative; top:7px;' title='Read More' alt='Read More'></a>
            <div id='service01' style='display:none; width:600px;margin-left:50px;padding:6px;border:1px dotted #bbbbbb;'><p><i>Copyright Act</i> provides that copyright subsists in &ldquo;every original literary, dramatic, musical and artistic work&rdquo;. However, the scope of copyright protection is not indefinite.<p>It is of utmost importance to clearly understand if a particular result of creative activity is protected by copyright &ndash; whether you are planning to rely on that IP as your asset or whether you are planning to use someone else&rsquo;s work.</div>
        </li>


        <li class='checkmark' onclick='togglemore("service02"); return false;'>whether a particular use of the work requires permission;
            <a href='#' onclick='return false;'><img id='imgservice02' src='/images/icons/openmore1.png' style='vertical-align:text-top; padding-left:8px; border:0px; padding-right:5px; position:relative; top:7px;' title='Read More' alt='Read More'></a>
            <div id='service02' style='display:none; width:600px;margin-left:50px;padding:6px;border:1px dotted #bbbbbb;'><p>Even if a work is protected by copyright, not every single use of it requires permission from the copyright owner.<p>Some uses fall under the category of fair dealing, and some uses fall outside the legal definition of what &ldquo;use&rdquo; means under the <i>Copyright Act</i>.</div>
        </li>


        <li class='checkmark' onclick='togglemore("service03"); return false;'>whether a particular use of the work infringes copyright;
            <a href='#' onclick='return false;'><img id='imgservice03' src='/images/icons/openmore1.png' style='vertical-align:text-top; padding-left:8px; border:0px; padding-right:5px; position:relative; top:7px;' title='Read More' alt='Read More'></a>
            <div id='service03' style='display:none; width:600px;margin-left:50px;padding:6px;border:1px dotted #bbbbbb;'><p>Under the <i>Copyright Act</i>, it &ldquo;is an infringement of copyright for any person to do, without the consent of the owner of the copyright, anything that by this Act only the owner of the copyright has the right to do.&rdquo;<p>The question is whether a particular use falls under the scope of what only the owner of copyright can do and whether a particular use can be excused under the fair dealing provisions.</div>
        </li>

        </ul>

1 个答案:

答案 0 :(得分:3)

IE6忽略了关闭</li>标记,因此第263行(无效定位)的内部<ul>被解释为位于其上方的<li>内,而在现代浏览器将其解释为<li>

的兄弟

您应该将内部<ul>放在外部<li>的{​​{1}}内来确定无效性。