我想创建一个javascript'wait'函数.我该怎么编辑?
function wait(waitsecs) {
setTimeout(donothing(), 'waitsecs');
}
function donothing() {
//
}
Run Code Online (Sandbox Code Playgroud) 我的 CSS 必须使用过渡来改变,到目前为止我一直用div:hover
它。
当您单击另一个时,需要激活转换div
,而不是当您将鼠标悬停在div
必须移动/更改的对象上时。
我怎样才能做到这一点 ?
谢谢
翻转
我知道HTML,javascript,CSS ...但我想使用HTML5制作原生/混合iPhone应用,但不使用像PhoneGap或Nimblekit这样的东西.我以前从未写过真正的(不是网络应用程序)iPhone应用程序,因此我对Xcode一无所知.我已经用我发现的教程创建了一个UIWebView,但它显示了一个网站(apple.com).如何将此显示设置为本地文件(index.html)?
我在ViewController.m中的代码(void)viewDidLoad:
[super viewDidLoad];
NSString *fullURL = @"html/index.html";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[_viewWeb loadRequest:requestObj];
Run Code Online (Sandbox Code Playgroud) 我一直在玩HTML5,但我无法完成以下任务.javascript必须要求获得访问麦克风的权限,然后必须将麦克风输入流式传输到计算机扬声器.这是我的javascript:
navigator.getUserMedia = ( navigator.getUserMedia || navigator.webkitGetUserMedia ||
navigator.mozGetUserMedia ||navigator.msGetUserMedia);
var aCtx;
var analyser;
var microphone;
if (navigator.getUserMedia) {
navigator.getUserMedia({audio: true}, function(stream) {
aCtx = new webkitAudioContext();
analyser = aCtx.createAnalyser();
microphone = aCtx.createMediaStreamSource(stream);
microphone.connect(analyser);
analyser.connect(aCtx.destination);
});
};
Run Code Online (Sandbox Code Playgroud)
但Chrome(和Opera)说
Uncaught TypeError: Failed to execute 'webkitGetUserMedia' on 'Navigator': 3 arguments required, but only 2 present.
Run Code Online (Sandbox Code Playgroud)
为什么需要更多的论点?任何人都可以帮我解决这个问题吗?
谢谢.
为什么以下不起作用?
JavaScript的:
document.getElementById("page").style = "-webkit-filter: blur(5px);";
Run Code Online (Sandbox Code Playgroud)
HTML:
<div id="page" style="" >some content</div>
Run Code Online (Sandbox Code Playgroud)
谢谢
javascript ×3
function ×2
html ×2
css ×1
hover ×1
html5 ×1
html5-audio ×1
iphone ×1
local ×1
microphone ×1
transition ×1
uiwebview ×1
wait ×1
xcode ×1