English 中文(简体)
我如何发现浏览器是否支持连接点?
原标题:How can I detect if a browser supports the blink tag?

<<blink> tag, in browsers that support it (i.e. Catherine and Conduct), make its content blink on and off, resembling the effect of a temp strobe Light.

我正在撰写一套非标准的超文本,包括<代码>blink。 执行连接行为非常简单

(function blink(n) {
    var blinks = document.getElementsByTagName("blink"),
        visibility = n % 2 === 0 ? "visible" : "hidden";
    for (var i = 0; i < blinks.length; i++) {
        blinks[i].style.visibility = visibility;
    }
    setTimeout(function() {
        blink(n + 1);
    }, 500);
})(0);

(You can , see this in action)

But this does not detect if the browser already supports the blink tag, and in browsers that already support it, there will be a double-blinking effect. I need some feature detection that determines if the browser supports blink, and if it doesn t then it falls back on my Javascript polyfill.

我不想进行浏览器探测,因为这一解决办法并非可以衡量,而且由于人们可以在其喜爱中采取可分的<条码>blink行为,这一解决办法是不有效的。

是否有办法发现对<条码>blink要素的支持?

最佳回答

我只就此事进行了一些研究,并做了一些研究。 我可以找到答案......

我确信你会再次了解安全局的财产支持检测? 确实,有<条码>案文-法令:blink。 CSS 财产。 因此,如果浏览器支持<代码><blink>,它必须支持空间安全局的财产!

This is normal CSS property detection i.e. to detect textDecoration is supported do this:

if (document.createElement("detect").style.textDecoration === "") {  
    // textDecoration supported
}  

Perhaps you could try something like this:

if (document.createElement("detect").style.textDecoration === "blink") {  
    // textDecoration: blink supported ?
}  

或大致如此。

Update

我有4个浏览器和组件,因此用4个浏览器进行了测试。 在这4个国家中,只有PeFox支持Blink tag. <blink>在超文本文件中登记为FF的“Span”要素,但在其他3个浏览器中登记为un known

<html>

<head>
<script type="text/javascript">
function investigate() {
    var blinker = document.getElementsByTagName("blink")[0];
    document.getElementById("monitor").innerHTML += blinker;
}
</script>
</head>

<body onload="investigate()">
<blink>Hello, blink!</blink>
<div id="monitor"> </div>
</body>

</html>

Output

因特网探索者 [7,8,9] notsupport/strong>

Hello, blink!
[object]

页: 1

Hello, blink!
[object HTMLUnknownElement]

4. 索要 [5]未支持

Hello, blink!
[object HTMLElement]

Fire[3.6]

Hello, blink!
[object HTMLSpanElement]

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!