【问题标题】:overflow:hidden not removing horizontal scrollbar from jQuery cycle in IE溢出:隐藏不从 IE 中的 jQuery 循环中删除水平滚动条
【发布时间】:2012-10-07 15:32:12
【问题描述】:

我正在使用 jQuery.cycle 来显示三个图像。与本网站上的其他答案保持一致,我结合使用 min-widthoverflow:hidden 来删除仅出现在 Internet Exploder Nein 中的水平滚动条。

如果相关,该网站同时使用 Yii 框架和蓝图。

水平滚动条不会消失。为什么?

动作

<?php
class IndexAction extends CAction
{
    public function run()
    {
        $ds = DIRECTORY_SEPARATOR;
        $cs = Yii::app()->clientScript;

        $cs->registerScriptFile( $ds. 'js' . $ds .
                  'jquery.cycle.all.js', CClientScript::POS_HEAD );

        $cs->registerScript( 'cycle', "$('.pics').cycle({
            fx: 'scrollLeft',
            containerResize: false,
            slideResize: false,
            width:960,
            height:300,
            fit:true
        });", CClientScript::POS_END );

        $this->controller->render('index');
    }
}

查看

<?php
Yii::app()->clientScript->registerCss('ServicesCycleSlideShow',"
.pics {  
    min-width:960px;  
    height:300px;  
    padding:0;
    margin:0;
    overflow:hidden;
} 

.pics img {  
    padding: 0;
    margin: 0;
    border:  none;  
    min-width:  960px; 
    height: 300px; 
    overflow:hidden;
}");
?>
<div class="pics"> 
    <img src="/images/1.png" width="960" height="300" /> 
    <img src="/images/2.png" width="960" height="300" /> 
    <img src="/images/3.png" width="960" height="300" /> 
</div> 

【问题讨论】:

    标签: jquery html internet-explorer yii blueprint-css


    【解决方案1】:

    我发现了问题。 jQuery.cycle 引入了overflow-x:scroll,它优先于overflow:hidden。添加overflow-x:hidden 会移除滚动条。

    【讨论】:

      猜你喜欢
      • 2021-06-30
      • 1970-01-01
      • 2014-05-10
      • 1970-01-01
      • 1970-01-01
      • 2013-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多