RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-234310

Misha Rodnoy's questions

Martin Hope
Misha Rodnoy
Asked: 2020-08-28 17:39:38 +0000 UTC

动画时弹出底部块

  • 0

单击时,文本会消失,这会移动代码中更进一步的块。我希望它落在上面。使用添加,position: absolute一切正常,但按钮消失。我希望按钮与文本一起离开。也许有人遇到并可以帮助解决这个问题?

https://jsfiddle.net/3cdkhkdt/7/

javascript
  • 2 个回答
  • 10 Views
Martin Hope
Misha Rodnoy
Asked: 2020-07-26 23:21:32 +0000 UTC

更改块高度时出错。不想接受 100%

  • 2

问题是它突然打开,但在相反的方向上它应该正常工作。

$('.test').click(function() {
  var test = $(this).prev();
  if (test.innerHeight() == 106) {
    test.animate({
      height: "100%",
    }, 1000);
  } else {
    test.animate({
      height: 106,
    }, 1000);
  }
});
p {
  background-color: #E3DEDE;
  height: 106px;
  overflow: hidden;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.1/jquery.min.js"></script>
<p>The best products begin with the best ingredients. Flour is milled only from select grades of the best wheat grains; the best nature has to offer, it looks like white powder. We have many varieties and formats for diverse applications.High quality grade.
  This sort of flour is pretty clear from which is preparing only from well-peeled grains. This grade of flour characterize by a low content of gluten and large amount of starch. This grade of flour has white color with a light milky shade. This grade
  often use in cooking, because batch turns out splendid and porous.The first grade of flout. This is the most popular grade, which allows for a small number of grain shells. This grade of flour is characterize large amount of gluten, which makes it possible
  to get a very elastic dough. This grade of flour has a light yellow color. Batches turns out volumetric and fragrant.The second grade of flour. This grate is characterized by a darker grayish color, which has a large number of grain envelopes this is
  allowing in the composition. Batches turns out lush and porous. This grade of flour don’t use for turn out for saltwater fish splashDifferent grade of flour differ from each other parameters: the amount of flour, which turn our from 100 kg of grain,
  product color, ash content, particle size, as well as the presence of bran and the amount of gluten.</p>
<button class="test">test</button>

如何出行?您需要单击以将块打开到最大高度。我觉得问题就出在这里。

height: "100%"

我试着把 auto 放在这里,它不起作用。只需要一个整数值。

jsfiddle示例

javascript
  • 1 个回答
  • 10 Views
Martin Hope
Misha Rodnoy
Asked: 2020-07-21 16:19:57 +0000 UTC

Yii2 手风琴 - 使第一个选项卡处于非活动状态

  • 0
echo Accordion::widget([
                'items' => [
                    [
                        'header' => 'Section 1',
                        'content' => 'Mauris mauris ante, blandit et, ultrices a, suscipit eget...',
                        'options' => ['tag' => 'div', 'active' => false],
                    ],
                    [
                        'header' => 'Section 2',
                        'headerOptions' => ['tag' => 'h3'],
                        'content' => 'Sed non urna. Phasellus eu ligula. Vestibulum sit amet purus...',
                        'options' => ['tag' => 'div'],
                    ],
                ],
                'options' => ['tag' => 'div'],
                'itemOptions' => ['tag' => 'div'],
                'headerOptions' => ['tag' => 'h2'],
                'clientOptions' => ['collapsible' => true],
            ]);

请告诉我如何使第一个选项卡默认处于非活动状态。它没有写在停靠栏中,但在 jquery 手风琴中有一个活动选项。我尝试应用它,但显然不在那些地方。

yii2
  • 2 个回答
  • 10 Views
Martin Hope
Misha Rodnoy
Asked: 2020-06-16 20:50:28 +0000 UTC

块垂直对齐和内容宽度

  • 0

.description-wrap {
  background: #FFD700;
  width: 1200px;
  height: 600px;
  text-align: center;
}

.description-table {
  display: table;
  border: 1px solid green;
  width: 100%;
  height: 100%;
}

.description-cell {
  border: 1px dashed red;
  display: table-cell;
  vertical-align: middle;
}

.description-text {
  border-top: 3px solid #000;
  border-bottom: 3px solid #000;
  padding: 15px 0;
  font-size: 40px;
  font-weight: normal;
  color: #000;
}

.description-text:first-child {
  margin-bottom: 5%;
}
<body>
  <div class="description-wrap">
    <div class="description-table">
      <div class="description-cell">
        <div class="description-text">БИРЮЧИЙ ОСТРОВ</div>
        <div class="description-text">АЗОВО-СИВАШСКИЙ НАЦИОНАЛЬНЫЙ
          <br>ПРИРОДНЫЙ ПАРК</div>
      </div>
    </div>
  </div>
</body>

问题是你需要根据 div 块中的内容来制作宽度。我想保留顶部和底部边框(比如


) 进行造型。像这样

我会很感激你的帮助。

css
  • 1 个回答
  • 10 Views
Martin Hope
Misha Rodnoy
Asked: 2020-03-08 22:09:06 +0000 UTC

使用命名空间的单调 PDO

  • 2

我正在尝试使用命名空间制作单调 PDO。这是连接 Db 类

namespace liw\components;

    class Db {

        private static $_db = null;

        private function __construct() {}
        private function __clone() {}
        private function __wakeup() {}

        public static function getInstance() {
            if (self::$_db === null) {        
                $dsn = "mysql:host=localhost;dbname=table";
                self::$_db = new PDO($dsn, 'root', '');
            }
            return self::$_db;
        }
  }

尝试访问模型中的 Db 类会导致错误

找不到类“liw\components\PDO”

    namespace liw\models;

    class Test {

      private $_db = null;

      public function __construct() {
          $this->_db = \liw\components\Db::getInstance();
      }

      public function getList() {       

        $list= array();

        $result = $this->_db->query("SELECT * FROM table");

        $i = 0;
        while ($row = $result->fetch()) {
            $list[$i]['id'] = $row['id'];            
            $i++;
        }

        return $list;
    }

  }

我知道有人试图创建一个没有命名空间的 PDO 类。如何解决?

pdo
  • 1 个回答
  • 10 Views
Martin Hope
Misha Rodnoy
Asked: 2020-03-06 01:27:26 +0000 UTC

使用变量和命名空间实例化一个类

  • 1

再会。

假设有一个变量$className = "Test"。您需要使用命名空间创建类的实例。

$classObject = new liw\controllers\$className;

会报错:

语法错误,意外的“$className”(T_VARIABLE)

如何摆脱这个问题?

如果你这样做,那么一切都会奏效,但这是对的吗?

$className = "Test";
$className = "liw\\controllers\\{$className}";
$classObject = new $className();
php
  • 1 个回答
  • 10 Views
Martin Hope
Misha Rodnoy
Asked: 2020-02-09 06:53:51 +0000 UTC

PDO的正确连接

  • 3

有一个连接到数据库:

class Db {

    public static function getConnection() {

        $paramsPath = ROOT . '/config/db_params.php';
        $params = include($paramsPath);

        $dsn = "mysql:host={$params['host']};dbname={$params['dbname']}";
        $db = new PDO($dsn, $params['user'], $params['password']);
        $db->exec("set names utf8");

        return $db;
    }

}

在每个类中,在每个方法中,我都这样做:

public static function getCategoriesList() {

    $db = Db::getConnection();

    $result = $db->query('SELECT id, name FROM category '
            . 'ORDER BY sort_order ASC');

   .........
}

如何摆脱这个糟糕的代码? $db = Db::getConnection();

如何在索引文件中调用连接而不是在每个方法中每次都连接?怎么可能创建一个连接类,在其他类中通过构造函数敲它呢?

php
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5