【问题标题】:What the?!? text in div wraps right everywhere but IE7. IE7 has one word per line?什么?!? div 中的文本在除 IE7 之外的任何地方都会换行。 IE7每行一个字?
【发布时间】:2010-01-19 12:40:55
【问题描述】:

我有一个无序列表,它是一种嵌套的 javascript 帮助框。您单击帮助主题,一个可滚动的 div 将显示帮助项目。这些帮助项是无序列表。

在 FF、Safari、IE6 中一切都运行良好(嗯,由于某种原因,我在 IE6 中得到了一个水平滚动条)和 IE8。但是在 IE7 中,它每行给我一个单词,并让滚动条变得很长,以进行补偿。我搜索了,但还没有看到我要找的东西。在 IE 的开发者工具中,对我来说没有什么明显的东西,但是当我将其切换到 IE7 模式时,问题又出现了。

感谢您的帮助! 乔尔

编辑: 一些代码...

帮助箱:

<div class="helpbox">
     <h2 class="title2a adjust"><a class="nodecoration" href="javascript:animatedcollapse.toggle('collapse1')">Quick Start</a></h2>
     <div id="collapse1" class="helpbox2">

              <ul id="helpbo">
                  <li class="helpchange"><a href="#">Add Items</a></li>
                  <li class="helpchange"><a href="#">Create Timeline</a></li>
                  <li class="helpchange"><a href="#">Set Reminder</a></li>
                  <li class="helpchange"><a href="#">Detailed Help Topics</a></li>
              </ul>
              <hr class="ninetypercent"></hr>

              <div class="instructions helpitems" id="animators">
                <div class="container"><ul>
                <li>Make sure the <b>Monthly</b> tab is highlighted on the top right of the screen.</li>
                <li>Click on the day that you want to add an event.</li>
                <li>You can create a main event-which you can apply a timeline to, or you can create a simple to-do item.</li>
                <li>Fill in the details.  If you are creating a main event, you can add a timeline.  If you don't know how to do that, read the <b>Create Timeline</b> help link above.</li>
                <li>Click <b>Save</b> when you're done.</li>
                <li>Your event or to-do will now show up in your calendar.</li>

                  </ul></div>

                  <div class="container"><ul>
                  <li>Click on the <b>Admin</b> tab on the top right of the screen.</li>
                  <li>In the main display, next to <b>Manage</b> click <b>Add Timeline</b></li>
                  <li>A new blank timeline template will appear.</li>
                  <li>Give a descriptive title of your timeline. You can always go back and edit things later if you need to.</li>
                  <li>The first column, <b>Days From Event</b>, is the number of days before or after the main event that you want the to-do item to happen.  It must be a number-negative numbers for the days before the event and positive number for days after the event.</li>
                  <li>Fill in the <b>Days From Event</b>, the <b>Title</b> and <b>Description</b> of each to-do item you want to create.</li>
                  <li>Click <b>Add More To-Do Items</b> to add another item.  Add as many items as you need.</li>
                  <li>If you have added <b>Team Members</b>, you can assign tasks to members in the <b>assigned to</b> column.</li>
                  <li>When you have finished your new timeline, click <b>Save Timeline</b>.</li>
                  <li>Your new timeline is now ready to be applied to your main events</li>
                  </ul></div>

                  <div class="container"><ul>
                  <li>You can set a reminder for a main event or a to-do item.</li>
                  <li>Make sure the <b>Monthly</b> tab is selected on the top right of the screen.</li>
                  <li>First, <b>Create or Select</b> the event that you want to set a reminder for.</li>
                  <li>If you have selected an existing event, click <b>Edit Event</b>.</li>
                  <li><b>Click</b> the <b>Checkbox</b> next to the word <b>Reminder</b>. </li>
                  <li>Set the date and time you'd like your reminder, and you'll get an email reminder then.</li>

                  </ul></div>

                  <div class="container"><ul>
                                    <li>For more detailed help on specific features, please click on the <b>Help</b> tab at the top right of the screen.</li>
                                    <li>There, you will find several <b>Tutorial Videos</b> That can walk you through more of the complex features.</li>

                  </ul></div>


              </div>
            <div class="closebutton">
                 <a href="javascript:animatedcollapse.toggle('collapse1')">close</a>
            </div>


      </div>
</div>

我正在使用 jQuery 和 animated.collapse 库。

js代码为:

<script type="text/javascript">
//<![CDATA[
  document.documentElement.className += " js"; // Add js class to the HTML element
  $(function(){
    var $containers = $("#animators > div").hide();

    $('ul#helpbo li a').each(function(i,el){
      var idx = i;
      $(this).click(function(e){
        var $target = $containers.filter(':eq(' + idx + ')');
        // Fade out visible div
        if($containers.filter(':visible').not($target).length){
          $containers.filter(':visible').fadeOut(500, function(){
            $target.not(':visible').fadeIn(500);
          });
        } else {
          $target.not(':visible').fadeIn(500);
        }

        e.preventDefault();
      })
    })
  });


$(".helpchange").click(function() {
  $(".changinghelp").removeClass("changinghelp");
  $(this).addClass("changinghelp");
});

//]]>

【问题讨论】:

  • 请提供代码,或者在线测试页面。您可以在线创建测试页面jsbin.com
  • 好的。我将包含代码,但它很大——附加了几个 js 库位。
  • 它在一个受密码保护的网站后面 :-( 我猜这不仅仅是一些众所周知的 IE7 错误?
  • 澄清一下——如果它有帮助......正是“容器”类正在解决这个问题。

标签: html css internet-explorer-7


【解决方案1】:

另一个愚蠢的菜鸟问题。我没有声明那些内部 lis 的宽度。它在其他浏览器上运行良好,因为它只是继承,但在 IE7 中没有

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-11-28
    • 2011-08-17
    • 1970-01-01
    • 2014-04-07
    • 2012-07-19
    • 1970-01-01
    • 2010-10-02
    相关资源
    最近更新 更多