http://nanobox.chipx86.com/browser_support.php
Web browser standards support summary
对网页标准(Web Standars)各种浏览器对比。后面这个是简表,看起来更直观一些。红色表示不好(不支持),绿色表示好(支持),大致可以看出 opera firefox 对网页标准支持较好,个人感觉 opera 要更好一点。IE?…:(
location.hash and addEventListener
http://virtuelvis.com/gallery/css3/target/interface.html
movement.js
var capX, capY;
var capture = false;
function init(){
d = document.getElementsByTagName(’div’);
// Set up event listener for mouseover on the viewport.
document.getElementsByTagName(’html’)[0].addEventListener(”mousemove”,doMove,true);
for (i = 0; i < d.length; i++){
if (d[i].className == "window") {
// add event listener for when you mouse down over a window.
d[i].addEventListener("mousedown",eFocus,false);
// Event listener for mousedown on a "window" header. To enable dragging.
d[i].getElementsByTagName('h2')[0].addEventListener("mousedown",startMove,false);
// Event listener to release window move.
d[i].getElementsByTagName('h2')[0].addEventListener("mouseup",endMove,false);
}
}
}
function eFocus(ev){
// Give focus to a window when it is clicked.
m = ev.currentTarget;
window.location.hash = m.id;
return false;
}
function startMove(ev){
// Enable window dragging.
var m = ev.currentTarget.parentNode;
// Find the offset values, so that the window doesn't
// "jump" when moved
if (!capX){ capX = ev.clientX - m.offsetLeft; }
if (!capY){ capY = ev.clientY - m.offsetTop; }
capture = ev.currentTarget.parentNode;
return true;
}
function endMove(ev){
// End window dragging
capX = false;
capY = false;
capture = false;
return true;
}
function doMove(ev){
// If the startMove has enabled capture, this window
// will enable moving of windows.
if (capture){
var m = ev.currentTarget;
capture.style.left = (ev.clientX - capX)+"px";
capture.style.top = (ev.clientY - capY)+"px";
}
}
window.onload = init;
Running scripts as soon as possible
http://userjs.org/help/tips_and_tricks/runnung-scripts-early
下载这个 linkify-txt.js,保存到某个目录中(最好在opera相关目录中),然后在 opera 的 tools - preferences - Content - Javascript options - My javascript file 中选择(或者输入)这个js文件的完整路径。
打开这个测试文本,你会看到文本中的链接(http ftp)被加入了链接,注意,这可是纯文本,只是在用opera浏览的时候被处理成了html。
注意:pera 8 版本需要在 opera6.ini 中在 [User Prefs] 后面加入
Always Load User JavaScript=1
我用的是 opera 9 beta 不需要。opera 自定义脚本就象 firefox 下的 greasemonkey。也许应该反过来说,greasemonkey 的想法正是来自 opera my javascript file 的启发。
更多说明在:Linkify text files
只对 opera有效,偷偷在浏览器显示区域之外放一个 div 然后 setInterval 计算其缩放比例。其中没有使用 innerHTML 或者 document.write 而使用 createElement 的方法(对 strict XHTML)也值得学习。
BTW:opera 缩放快捷键是 + - *(恢复原大),firefox 多一个 Ctrl 键。
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
window.onload = function(){
this.lastHeight, this.lastWidth;
var self=this;
this.measureZoom = function(){
var s = document.getElementById("ozMeasure");
s.style="display:block;position:fixed;left:-65536px;top:0;height:100%;z-index:-32";
if (self.lastHeight != s.offsetHeight){
var zoom = window.innerHeight/s.offsetHeight;
document.getElementById("oZoomlevel").style.fontSize = (2/zoom)+"em";
document.getElementById("oZoomlevel").style.left = (0.5/zoom)+"em";
document.body.style.marginTop = (5/zoom)+"em";
var zoom_correction = Math.round(zoom*100)%10;
if (zoom_correction > 5){
zoom = Math.round(zoom*100)+(10-zoom_correction);
} else {
zoom = Math.round(zoom*100)-(zoom_correction);
}
document.getElementById("oZoomlevel").innerHTML="Zoom level: "+zoom;
}
// s.style="display:none;"
self.lastHeight = s.offsetHeight;
}
if(window.opera){
var d = document.createElement("div");
d.id="ozMeasure";
d.style="position:fixed;left:-100px;top:0;height:100%;width:1px";
document.documentElement.appendChild(d);
var p = document.createElement("p");
p.id = "oZoomlevel";
p.style="position:fixed;top:0;margin:0";
document.body.appendChild(p);
f = setInterval(this.measureZoom,54);
} else {
var p = document.createElement("p");
p.innerHTML="This demo requires the Opera web browser to work. ";
p.className = "notCompatible";
var l = document.createElement("a");
l.innerHTML="Download Opera!";
l.href="http://www.opera.com";
p.appendChild(l);
document.body.insertBefore(p,document.getElementsByTagName('noscript')[0]);
}
}
The Opera browser has a unique feature in that it allows full-page zoom, where you zoom both images and text, as opposed to most other browsers’ text size feature.
Users of the Opera web browser should be seeing a zoom indicator in the upper left corner of the screen that displays the current zoom level, and it should remain roughly the same size as you resize the page. The presented result is fairly accurate when the zoom levels are not to extreme, but as you zoom in, the precision is ultimately limited by two factors: Window size and float precision. With a browser window running full-screen on 640×480, the first erronous result appears when zoom level is 500%, when the calculation returns 520%, at 1024×768, the first error appears at 660%, where the calculation returns 650%.
This demonstration is attached to the weblog entry How to detect zoom in Opera.
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
via http://virtuelvis.com/archives/2005/05/opera-measure-zoom
在F12中只能关掉,而不能再打开。找了一下,原来就是 opera bug
即便使用 opera button 也是一样的问题,:(
opera:/button/Enable proxy servers|Disable proxy servers
在不同文档中传递消息,Cross-document messaging in Opera,这里有个例子
记得 MSDN也有一个类似方法,好像是个控件,能够纪录附加信息在某个文档上,即使另存为本地也依然存在。感觉这类东西意思不大,难以普及。