簡體   English   中英

如何使彈出窗口在 yii2 中水平滾動

[英]How to make popup scroll horizontally in yii2

我的 yii2 布局中有這個彈出部分。 它在必要時自然地向下滾動,但不是水平滾動。 我怎樣才能讓它水平滾動,或者我能做到嗎?

<?php

/* @var $this \yii\web\View */
/* @var $content string */

use app\widgets\Alert;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="en">
<head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <title><?= Html::encode($this->title) ?></title>
     <!-- Tell the browser to be responsive to screen width -->
     <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
     <link rel="icon" href="images/favicon.ico" type="image/x-icon" />
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>


    <!-- Create modal -->

        <!-- <div class="modal-body"> -->

                <?= $content ?>

        <!-- </div> -->


<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>

此彈出窗口包含在 web/themes/default/views/layout

我的工作正常,使用溢出-y:滾動; 在你的模態體 div 之后

<?php

/* @var $this \yii\web\View */
/* @var $content string */

use app\widgets\Alert;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="en">
<head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <title><?= Html::encode($this->title) ?></title>
     <!-- Tell the browser to be responsive to screen width -->
     <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
     <link rel="icon" href="images/favicon.ico" type="image/x-icon" />
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>

    <!-- Create modal -->

        <!-- <div class="modal-body"> -->
            <div style ="overflow-y: scroll;">
                <?= $content ?>
            </div>
        <!-- </div> -->


<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM