小编Roh*_*rma的帖子

当我尝试打印网页时,为什么每个打印页面都没有重复内容?

我有一张桌子,我正在尝试打印它.它在正常模式下工作正常,但是当我旋转时,th它在第一个打印页面中可见,但在其他页面上不可见.

th span {
  transform-origin: 0 50%;
  transform: rotate(-90deg);
  white-space: nowrap;
  display: block;
  position: relative;
  top: 0;
  left: 50%;
}
Run Code Online (Sandbox Code Playgroud)
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">

<table class="table table-bordered">
  <thead>
    <tr>
      <th><span style="transform-origin: 0 50%;
        transform: rotate(-90deg);
        white-space: nowrap;
        display: block;
        position: relative;
        top: 0;
        left: 50%;">Firstname</span></th>
      <th>Lastname</th>
      <th>Email</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>John</td>
      <td>Doe</td>
      <td>john@example.com</td>
    </tr>
    <tr>
      <td>Mary</td>
      <td>Moe</td>
      <td>mary@example.com</td>
    </tr>
    <tr>
      <td>July</td>
      <td>Dooley</td>
      <td>july@example.com</td>
    </tr>

    <tr>
      <td>Mary</td>
      <td>Moe</td>
      <td>mary@example.com</td>
    </tr>
    <tr>
      <td>July</td>
      <td>Dooley</td>
      <td>july@example.com</td>
    </tr>
    <tr>
      <td>John</td> …
Run Code Online (Sandbox Code Playgroud)

html javascript css printing jquery

7
推荐指数
2
解决办法
835
查看次数

为什么 bootstrap 4 滑块工作不顺畅?

我有自定义bootstrap4滑块是工作,但没有平滑当我点击nextprev按钮,滑块是突然而不是顺利。我怎么能做到这一点,你有什么想法可以解决这个问题吗?

下面给出的滑块:-

$('.carousel-item', '.multi-item-carousel').each(function() {
  var next = $(this).next();
  if (!next.length) {
    next = $(this).siblings(':first');
  }
  next.children(':first-child').clone().appendTo($(this));
}).each(function() {
  var prev = $(this).prev();
  if (!prev.length) {
    prev = $(this).siblings(':last');
  }
  prev.children(':nth-last-child(2)').clone().prependTo($(this));
});
Run Code Online (Sandbox Code Playgroud)
.multi-item-carousel {
  overflow: hidden;
}

.multi-item-carousel .carousel-indicators {
  margin-right: 25%;
  margin-left: 25%;
}

.multi-item-carousel .carousel-control-prev,
.multi-item-carousel .carousel-control-next {
  /* background: rgba(255, 255, 255, 0.3); */
  width: 25%;
  z-index: 11;
  /* .carousel-caption has z-index 10 */
}

.multi-item-carousel .carousel-inner {
  width: 240%;
  left: -70%;
} …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery bootstrap-4

7
推荐指数
1
解决办法
1281
查看次数

React Hook“useState”无法在顶层调用。React Hooks 必须在 React 函数组件或自定义 React Hook 函数中调用

React Hook 无法工作,给出错误,如所附屏幕截图所示:- 在此输入图像描述

我的代码:-

import React, { useState} from 'react';

import WEBINAR_LIST from './webinar_data';

const [ page, setPage ] = useState(0); //create page state

const pageData = useMemo(() => {

     return WEBINAR_LIST.slice(page*5, (page*5)+5)
},[page])

const nextPage = () => setPage(prev => prev+1)
const prevPage = () => setPage(prev => prev > 0 ? prev-1 : prev) 
Run Code Online (Sandbox Code Playgroud)

谢谢!

reactjs

7
推荐指数
1
解决办法
4万
查看次数

我们如何在 Angular 4 中获取 HttpClient 状态代码

嗨,Angular 新手,我在获取 HTTP 模块中的 HTTP 状态代码时遇到问题,我可以使用response.status轻松获取响应代码,但是当我使用HttpClientModule 时,我无法获取 response.status,它显示找不到地位。

所以,我怎样才能得到使用response.statusHttpClient模块Angular 4&5。请帮忙。

休息提供者:-

@Injectable()
export class RestProvider {

  private apiUrl = 'https://restcountries.eu/rest/v2/al';

  constructor(public http: HttpClient) {
    console.log('Hello RestProvider Provider');
  }

  getCountries(): Observable<{}> {
    return this.http.get(this.apiUrl).pipe(
      map(this.extractData),
      catchError(this.handleError)
    );
  }

  private extractData(res: Response) {
    let body = res;
    return body || { };
  }

  private handleError (error: Response | any) {
    let errMsg: string;
    if (error instanceof Response) {
      const err = error || ''; …
Run Code Online (Sandbox Code Playgroud)

angular

6
推荐指数
2
解决办法
3万
查看次数

使用 NuGet 下载 jQuery 后如何使用它

我使用\n下载jQueryVisual Studio 2017\ Install-Package bootstrap -Version 4.1.1
n现在我有一个包含jQuery 3.3.1的依赖项,但是当我移动到我的脚本文件时,我可以\xc2\xb4t访问,并且当我输入时jQuery我没有\n\nIntelliSense是否有一些参考必须输入,才能在我的脚本文件中使用?jQuery$.
jQuery

\n\n

在此输入图像描述

\n

jquery visual-studio nuget

6
推荐指数
1
解决办法
4928
查看次数

slice() 不能与 jQuery 正常工作?

slice() 无法正常工作。我想显示 4-4 个 div。它正在工作,但并非所有 div 都被显示。现在我有 30 个盒子 div,但是当我向下滚动时,它只显示 24 个 div,为什么?我想显示所有的div。

$(window).scroll(function() {
  var position = $(window).scrollTop();
  var bottom = $(document).height() - $(window).height();

  if (position == bottom) {
    var row = Number($('#row').val());
    var allcount = Number($('#all').val());
    var rowperpage = 3;
    row = row + rowperpage;

    if (row <= allcount) {
      $('#row').val(row);
      $(".coupon-box:visible").last().nextAll('.coupon-box').slice(0, 4).fadeIn(1000);
    }
  }
});
Run Code Online (Sandbox Code Playgroud)
.coupon-box {
  width: 200px;
  height: 120px;
  background: #ccc;
  margin: 25px;
  padding: 20px;
  text-align: center;
  padding-top: 100px;
}

.d-none-custom {
  display: none;
} …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery

5
推荐指数
1
解决办法
137
查看次数

如何在滚动时平滑更改图像大小?

我有一个带有大徽标的标题,我想在滚动超过 100 像素后将其缩小,这工作正常但不流畅,我怎样才能让它平滑?

我的代码:-

$(function(){
    $(window).scroll(function(){
        if($(this).scrollTop() > 100){
            $('header').addClass('fixed-header');
        }
        else{
            $('header').removeClass('fixed-header');
        }
    });
});
Run Code Online (Sandbox Code Playgroud)
header{ padding:0px; position: sticky; top:0px; left:0px; background: #FFF; z-index: 1000;}
header.fixed-header{box-shadow: 20px 4px 10px rgba(39, 59, 69, 0.2);}

header .logo img{width:200px;}
header.fixed-header .logo img{width:100px;}

.box-height{ height:500px;}
Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<header>
    <div class="col-md-4">
      <a href="#" class="logo"><img src="https://www.freepnglogos.com/uploads/google-logo-png-hd-11.png"></a>
  </div>
</header>

<div class="box-height"></div>
Run Code Online (Sandbox Code Playgroud)

javascript css jquery smoothing smooth-scrolling

3
推荐指数
1
解决办法
4423
查看次数

动漫js问题(完整功能)

我正在尝试复制此链接中提到的动画。

http://tobiasahlin.com/moving-letters/#13

不同之处在于,一旦淡出和过渡动画完成,我需要更改内容并将其替换为新内容。

我尝试使用anime js's完整功能更改文本。

看看代码。

var styleindex = 0;
       var stylearray = ["SEO","SMM"];
       function eachletter(){
        $('.l1').each(function(){
              $(this).html($(this).text().replace(/([^\x00-\x80]|\w)/g, "<span class='letter'>$&</span>"));
          });
          }
          eachletter();
          anime.timeline({loop: true})
              .add({
              targets: '.l1 .letter',
              translateY: [100,0],
              translateZ: 0,
              opacity: [0,1],
              easing: "easeOutExpo",
              duration: 1400,
              delay: function(el, i) {
                  return 300 + 30 * i;
              }
          }).add({
              targets: '.l1 .letter',
              translateY: [0,-100],
              opacity: [1,0],
              easing: "easeInExpo",
              duration: 1200,
              delay: function(el, i) {
                  return 100 + 30 * i;
              },
               complete: function(anim) {
                   $(".l1").text(stylearray[styleindex]);
                    eachletter(); …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery anime.js

2
推荐指数
1
解决办法
6958
查看次数

RxJS - 哪个运营商可以结合最近N个事件的历史记录?

我正在寻找一个运算符,它将流转换为具有历史记录或最后N个事件的流.

所以对于像这样的流:

clicks$.subscribe((ev) => ...)
Run Code Online (Sandbox Code Playgroud)

我希望有类似的东西:

clicks$.pipe(
   historyOf(2)
).subscribe(([ev, ev-1, ev-2]) => ...)
Run Code Online (Sandbox Code Playgroud)

这样的运营商是否存在,或者是否有一种简单的方法来组合现有的运营商以达到预期的效果?

javascript rxjs

2
推荐指数
1
解决办法
56
查看次数

如何将下划线从中心而不是向左悬停?

我有一个ul列表,并且我已经给出了悬停效果,使用:after它可以在悬停上正常工作,但是现在我希望它将从中心开始而不是从左开始。

我的代码:

ul.my-list{ margin: 20px; padding: 0px; width: 200px;}
ul.my-list li{ list-style: none; position: relative; display: inline;}
ul.my-list li a{ color:#333; text-decoration: none;}
ul.my-list li:after{ content: ''; position: absolute; left: 0px; bottom: -2px; width:0px; height: 2px; background: #333; transition: all 0.45s;}
ul.my-list li:hover:after{ width: 100%;}
ul.my-list li a:hover{ text-decoration: none;}
Run Code Online (Sandbox Code Playgroud)
<ul class="my-list">
  <li><a href="#">Welcome to my website</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)

html css

2
推荐指数
2
解决办法
157
查看次数