我的HTML:
<!-- Content -->
<div class="content">
<!-- Content left -->
<div class="content-left"></div>
<!-- Content center -->
<div class="content-center">
</div>
<!-- Content right -->
<div class="content-right"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
我的CSS:
.content
{
background-color: black;
height: auto;
margin: 80px auto 0px auto;
min-height: 100px;
padding: 10px 10px;
width: 1200px;
}
.content-center
{
-khtml-box-shadow: 0px -3px 5px rgba(0,0,2,2);
-moz-box-shadow: 0px -3px 5px rgba(0,0,2,2);
-webkit-box-shadow: 0px -3px 5px rgba(0,0,2,2);
background-color: #ffffff;
border-left: 1px solid;
border-right: 1px solid;
border-color: #999999;
box-shadow: 0px -3px …Run Code Online (Sandbox Code Playgroud) 我在IE(6,7,8)的网站上遇到了这个问题:
'nodeType'为null或不是对象
该错误引用"f.nodeType"属性.基本上f是未定义的,所以问题出在之前,但我无法解决它.
(从IE开发人员工具栏调试它似乎是抛出错误的这一行)(autocolumn.min.js line 13为了便于阅读,扩展如下)
页面位于http://www.donatellabernardi.ch/drupal
function split($putInHere,$pullOutHere,$parentColumn,height){
if($pullOutHere.children().length){
$cloneMe=$pullOutHere.children(":first");
$clone=$cloneMe.clone(true);
if($clone.attr("nodeType")==1&&!$clone.hasClass("dontend")){
^^^^^^^^^^^^^^^^^^^^^^^^^^ Chokes on
$putInHere.append($clone);
if($clone.is("img")&&$parentColumn.height()<height+20){
$cloneMe.remove();
}else if(!$cloneMe.hasClass("dontsplit")&&$parentColumn.height()<height+20){
$cloneMe.remove();
}else if($clone.is("img")||$cloneMe.hasClass("dontsplit")){
$clone.remove();
}else{
$clone.empty();
if(!columnize($clone,$cloneMe,$parentColumn,height)){
if($cloneMe.children().length){
split($clone,$cloneMe,$parentColumn,height);
}
}
if($clone.get(0).childNodes.length==0){
$clone.remove();
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 我正在构建一个/ v html5流媒体网络应用程序.这个问题取决于项目的音频部分,但我确信当我开始使用视频部分时,我会遇到类似的情况.我的目标设备是iPad的Safari浏览器(因此我必须这样做html5).播放工作正常,但我有一个加载栏,需要反映已加载了多少轨道.遵循w3规范,我尝试使用jQuery以下方式实现:
var that = this;
that.player = $('audio')[0];
$('that.player').bind('progress',function(){
var buffer = that.player.buffered.end(0)
that.updateLoadBuffer(buffer);
});
Run Code Online (Sandbox Code Playgroud)
这没用.'that.player.buffered'返回一个TimeRanges对象,TimeRanges有一个方法'end(index)',它返回缓冲区结束的回放位置,以秒为单位,由'index'指定的TimeRange.TimeRanges还有一个.length属性,告诉你对象封装了多少个TimeRanges.当我试图记录该属性时,我发现TimeRanges.length = 0,意味着没有传回TimeRanges.此外,当我将记录语句抛入绑定函数时,我发现'progress'事件从未被触发过.我有'loadedmetata'和'timeupdate'事件的单独函数,它们遵循类似的格式,并按预期启动.我尝试了其他捕获事件的方法无济于事:
that.player.onprogress = function(e){
console.log('progressEvent heard');
};
that.player.addEventListener('progress',progressHandler, false)
function progressHandler(e){
console.log('progressEvent heard');
};
Run Code Online (Sandbox Code Playgroud)
这些都没有触发我的控制台消息.我的音频标签声明如下:
<audio style="width:0;height:0;"></audio>
Run Code Online (Sandbox Code Playgroud)
我在这做错了什么?
更新:我使用wowzamediaserver来处理http流.我不知道这是否与它有任何关系.
另一个更新:我意识到我的音频标签中没有源,因为我使用jquery动态设置它,如下所示:
$('audio').attr('src','http://my.wowza.server:1935/myStreamingApp/_definst_/mp3:path/to/my/track/audio.mp3/playlist.m3u8');
Run Code Online (Sandbox Code Playgroud)
再次,我没有回放问题,所以这不应该对我的问题有任何影响,但我只想尽可能地给你们一个图片.
安装程序
我的设置是为两个或多个具有相似结构但不同内容的站点共享资源.在例子中......
http:// localhost/site1 /
http:// localhost/site2 /
有两种类型的重写,CMS内容(几乎只是回显到页面的内容)和特殊模块(例如博客软件模块),其中我有软件可以从数据库中更具体地处理内容.
因此博客的第一个重写规则确保博客模块处理博客请求....
http:// localhost/site1/blog/*
http:// localhost/site2/blog/*
...使用位于...的博客模块软件
http:// localhost/blog /
CMS重写规则旨在处理非特定模块请求...
http:// localhost/site1/*
http:// localhost/site2/my_page.html*
...使用位于...的CMS重写软件
http:// localhost/rewrite.php
问题
博客模块和CMS模块重写是冲突的.我试图使用以下规则进行例外处理.这是我的代码......
RewriteEngine on
RewriteCond %{REQUEST_URI} !\.js$
RewriteRule .*/blog(.+) blog$1 [QSA]
RewriteRule !.*/(admin|blog|forums)(.+)$ rewrite.php
Run Code Online (Sandbox Code Playgroud)
最后一条规则实际上不起作用.使用此代码,如果我访问..
http:// localhost/site1/blog/*
http:// localhost/site2/blog/*
...任何网站的任何博客(或管理员或论坛)URL仍在被重写以与localhost/rewrite.php一起使用.
那么如何调整最后一条规则以满足以下条件呢...
1.)第一个目录(localhost/site1/blog中的site1或site2)仍然是动态的,所以如果我愿意,我可以添加第三个站点,而不必因为任何原因重新调整代码.
2.)博客(或管理员或论坛)索引(例如blog /,forums /,admin /)由他们自己的模块以及这些目录中的任何内容处理(例如admin/1,admin/test.html)无论HTTP代码,200,404等.
3.)任何不在最后一个规则的例外列表中的URL由rewrite.php处理(无论HTTP代码,200,404等).
4.)localhost/site1/blog /不由rewrite.php处理,localhost/site1/random_path不由blog模块重写处理.
我很乐意快速回复任何进一步的澄清.
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#test iframe {
border: none;
background: #333;
width: 500px;
height: 500px;
overflow: hidden;
}
#test iframe:before {
display: block;
content: " test";
width: 500px;
height: 500px;
background: url('overlay.png') no-repeat;
position: relative;
top: 0px;
left: 0px;
z-index: 999;
}
</style>
</head>
<body>
<div id="test">
<p><iframe></iframe></p>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我正在尝试将图像放在一个iframe但由于某种原因::before选择器不相处iframe- 尝试用iframe任何其他元素替换它并且它起作用.我需要iframe成为p元素的孩子.
在Gecko/Firefox中我收到了错误消息:
TypeError:fr.readAsDataurl不是函数
使用以下JavaScript:
var fr = new FileReader();
fr.readAsDataURL(files[i]);
Run Code Online (Sandbox Code Playgroud) 使用CSS flex我试图让所有内联元素居中,除了一个内联元素在右边对齐.我不想扩大盒子的大小或改变与垂直轴有关的任何东西.我无法获得这个CSS Flexbox生成器可以自己生成的任何东西.如果我添加margin-left最后一个元素,那么所有其他元素都对齐到左边.在那之后,如果我添加margin-left: auto;和margin-right: auto;所有其他元素,他们展开.横向和纵向之间的区别无济于事.
如何保持前三个元素保持分组和居中,只更改最后一个元素的水平布局?我宁愿能够继续使用margin-right: 2px;它,而不是在它的边界上.parentNode.parentNode
<header>
<span>Item 1</span>
<span>Item 2</span>
<span>Item 3</span>
<span>Item 4</span>
</header>
Run Code Online (Sandbox Code Playgroud)
我想要实现的目标的视觉演示:
我正在学习ES6,我只想将我的ES5知识转换为ES6。
这是我的ES5代码:
function click() {
this.className += ' grab';
setTimeout(() => (this.className = 'remove'), 0);
};
Run Code Online (Sandbox Code Playgroud)
这是我的ES6代码:
const click = () => {
this.className += ' grab';
setTimeout(() => (this.className = 'remove'), 0);
console.log('RENDERING');
}
Run Code Online (Sandbox Code Playgroud)
我的问题是this.className + ='抓住'; 和setTimeout(()=>(this.className ='remove'),0); 没有运行该功能。但是console.log会显示在日志中。
是该方法不上箭头职能的工作?
<h1 style="font-size:2.5vw;">Example</h1>我的 HTML 文件中有一个。我一直在使用“Chrome DevTools”(Google Chrome 的开发人员工具)测试它在不同视口大小中的外观。
我发现当设备设置为“iPad Pro”(1024x1366) 时,与 HTML 中的其余内容相比,标头太大。
为了解决这个问题,我想知道是否有一种方法可以在合并时设置标题元素的最大大小"font-size:2.5vw;"(我需要它仍然对视口的大小做出响应)?
我尝试添加max-width://size到style元素的字段中,但这没有什么区别。
注意:我的meta元素如下所示:<meta name="viewport" content="initial-scale=0.41, maximum-scale=1.0" />
css ×4
html ×2
javascript ×2
jquery ×2
apache ×1
css3 ×1
events ×1
filereader ×1
flexbox ×1
function ×1
html5 ×1
iframe ×1
ipad ×1
mod-rewrite ×1
php ×1