小编Max*_*ler的帖子

为什么连字符不能与 lang en 一起使用

这段代码有什么问题,连字号不起作用lang="en"

h1 {
  font-size: 2em;
  hyphens: auto;
}

div {
  max-width:200px;
  background: aqua;
}
Run Code Online (Sandbox Code Playgroud)
<div>
  <h1 lang="en">Kindofverylongheadlineevenbiggerthanimagined</h1>
  <h1 lang="en">Internationalization</h1>
  <h1 lang="de">Kindofverylongheadlineevenbiggerthanimagined</h1>
</div>
Run Code Online (Sandbox Code Playgroud)

html hyphenation

5
推荐指数
0
解决办法
1435
查看次数

YouTube Iframe-API:在'onStateChange'函数中获取iframe-id

我正在使用YouTube JavaScript API来控制我页面上的YouTube播放器.当我开始一个新视频时,目标是停止所有正在播放的视频.

已经经历了各种YouTube嵌入选项的挣扎,比如单个视频,播放列表等.我提出了一个问题,这将使我的生活更加轻松.

像这样初始化玩家:

// Array to store YTplayers
var YTplayers = [];

// Select all YouTube iframes
var YTembeds = $('iframe[src*="youtube.com"], iframe[src*="youtube-nocookie.com"]'); 

YTEmbeds.each(function(i) {
    iframe = $(this);

    // Generate and add the unique identifier for the current iframe
    var iframe_id = "iframe-youtube-" + i;
    iframe .attr("id", iframe_id);

    // Check if src already has a "?" and add "?" or "&" accordingly
    // then add the necessary "enablejsapi=1" option and update the src. 
    var url = iframe .attr("src");
    url …
Run Code Online (Sandbox Code Playgroud)

youtube youtube-api youtube-iframe-api

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