很遗憾,即使是 opera 也不支持 css3 的 background-size,还能指望谁呢?:(

[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
所以只能采用 z-index 来模拟背景。
test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!! test!!!!!!

[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
注意:opera 在缩放图片的时候使用的是 bi-linear(双线性),而其他浏览器用的是 nearest-neighbor。如果你不清楚二者的区别,可以搜索相关资料。一般做图软件(photoshop,firefox)缩放图片时默认的算法就是bi-linear,质量较好。nearest-neighbor 质量差,速度快,但有一种特殊用途就是放大像素图,不产生抖动或者说高斯模糊。自己搜吧,这不是讲图片设计的地方。
作为表单交互设计的一个基本元素,accesskey属性在windows面板中使用得很多,可我们的程序员们却都对它不感兴趣,当然这和我们的非拼音文字有很大的关系。但如果是类似电信营业、财务等需要大量录入的系统,只用鼠标显然是愚蠢的。当然 tab 和→←↑↓也可以满足很多需求。简单地理解就是 — 没有鼠标,一样也可以自由的在网页中穿行。
下面只说 accesskey
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
在windows中,按 alt+n 键切换焦点到 oName 表单域中;Mac,按 ctrl+n;opera 是个特例,需要 shift+ESC+n 。
类似地,链接也可以通过这样的操作来获得(甚至直接触发)焦点。
当然,用户不可能看源代码去找这个 accesskey,所以我们需要在表单中注明:
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
进一步,可以通过样式表 :after 来减少代码量。很遗憾,IE 6 看不到效果。
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
这里有个小问题需要解释一下。很多采用网页新标准的 blog 会使用 1,2,3…做为主导航的 accesskey,这在opera下面会有问题,因为 opera 的功能键是 shift+ESC,因为shift所以 1 不起作用,!可以。用opera看下面小例子,其它浏览器没有这个问题。
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
还可以通过 title 来提示用户可使用的 accesskey
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
为了代码更漂亮更简洁,可以js 来自动装换 accesskey -> title,这是导航菜单
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
加入提示效果后:
function ua(str){
haveUa=navigator.userAgent.toLowerCase().indexOf(str)+1;
return haveUa;
}
window.onload=function(){
if (document.getElementsByTagName){
oLinks=document.getElementsByTagName("a");
for(i=0;i if(ua("opera")){ oLinks[i].setAttribute("title","快捷方式:Shift+Esc+"+oLinks[i].getAttribute("accesskey")) }else if(ua("mac")){ oLinks[i].setAttribute("title","快捷方式:Ctrl+"+oLinks[i].getAttribute("accesskey")) }else if(ua("win")){ oLinks[i].setAttribute("title","快捷方式:Alt+"+oLinks[i].getAttribute("accesskey")) } } } }
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
受dodo老人家启发…实际应用中,可能远比这复杂…
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
http://blog.94smart.com/index.php?q=node/256
http://www.kenlee.cn/index.php?job=art&articleid=a_20050614_031309
路径重定向以及tag 提示,代码很有意思,虽然看得人头疼…回头拉住zdg,一定要问个痛快。
var alltags = {”新闻”:{x:1,y:243},”互联网”:{x:58,y:164},”webdesign”:{x:1874,y:153},”blog”:{x:47,y:72},”Firefox”:{x:110,y:71},”Linux”:{x:184,y:45},”生活”:{x:8,y:31},”软件使用”:{x:113,y:25},”CSS”:{x:137,y:22},”opera”:{x:3426,y:13},”war3″:{x:2082,y:11},”Windows”:{x:384,y:11},”娱乐”:{x:2,y:7},”唐都房”:{x:3104,y:6},”私有”:{x:9,y:2},”test”:{x:344,y:2},”rdf”:{x:2098,y:2},”uidesign”:{x:3310,y:2},”Wiki”:{x:152,y:2},”RSS”:{x:435,y:2},”IT”:{x:5,y:1},”历史”:{x:421,y:1},”Feed”:{x:382,y:1},”browser”:{x:2497,y:1},”ajax”:{x:5144,y:1},”其他”:{x:10,y:0},”财经”:{x:4,y:0},”文化”:{x:7,y:0},”体育”:{x:3,y:0},”军事”:{x:6,y:0}};var tagselected = []
String.prototype.trim = function(){ return this.replace(/^s+|s+$/g,”) }
String.prototype.escRegExp = function(){ return this.replace(/[\$*+?()=!|,{}[].^]/g,’\$&’) }
String.prototype.unescHtml = function(){ var i,t=this; for(i in e) t=t.replace(new RegExp(i,’g'),e[i]); return t }
function Suggestions() { this.length=0; this.picked=0 }
var suggestions = new Suggestions()
var tagSearch=’ ‘, lastEdit=”
var h={}, sections=[{},{},{},{},{}], selected={}, currentTag={}, e={’<':'<','>‘:’>',’&':’&',’”‘:’”‘}
function init() { var elements = ['suggest','newTags','Tags'], t,i
for(i in elements) h[elements[i]] = document.getElementById(elements[i])
for(t in alltags) {
tagSearch += t + ‘ ‘
var tagid = alltags[t]['x']
var id = alltags[t]['y']
var title = t+’['+id+']‘
var sel = false
for (j in tagselected) {
if (tagid==tagselected[j]) { sel=true; break;}
}
if (sel){ h.Tags.options.add(new Option(title,tagid),0);h.Tags.options[0].selected=true}
else{ h.Tags.options.add(new Option(title,tagid));}
}
document.onkeydown = document.onkeypress = document.onkeyup = handler
updateHilight()
}
function makeTag(parent, tag, js) {
parent.appendChild(document.createTextNode(’ ‘))
var obj = document.createElement(’a')
obj.className = ‘tag’
obj.setAttribute(’href’,'javascript:’+js+’(”‘+tag.replace(/”/g,’\”‘)+’”)’)
obj.appendChild(document.createTextNode(tag))
if(alltags[tag] < 2) obj.style.color = '#66f'
if(alltags[tag] == 2) obj.style.color = '#44f'
parent.appendChild(obj)
return obj
}
function select(t) { var i; t=t.toLowerCase()
selected[t] = true; for(i in sections) if(sections[i][t]) sections[i][t].className = 'tag selected'
}
function deselect(t) { var i; t=t.toLowerCase()
delete selected[t]; for(i in sections) if(sections[i][t]) sections[i][t].className = 'tag'
}
function complete(tag) { var tagArray=h.newTags.value.split(' ')
if(typeof tag == 'undefined') tag = suggestions[suggestions.picked].innerHTML.unescHtml() // tab complete rather than click complete
tagArray[currentTag.index] = tag
var text = tagArray.join(' ')
h.newTags.value = (text.substr(-1,1) == ' ' ? text : text + ' ' )
hideSuggestions()
updateHilight()
focusTo(h.newTags)
}
// focus the caret to end of a form input (+ optionally select some text)
var range=0 //ie
function focusTo(obj, selectFrom) {
if (typeof selectFrom == 'undefined') selectFrom = obj.value.length
if(obj.createTextRange){ //ie + opera
if (range == 0) range = obj.createTextRange()
range.moveEnd("character",obj.value.length)
range.moveStart("character",selectFrom)
obj.select()
range.select()
setTimeout('range.select()', 10) // must use a timer to get around bullshit ie bug
} else if (obj.setSelectionRange){ //ff
obj.select()
obj.setSelectionRange(selectFrom,obj.value.length)
} else { //safari ![]()
obj.blur()
}}
function updateHilight() {
var tagArray=h.newTags.value.toLowerCase().split(' '), tagHash={}
if (tagArray[0].trim() == '') tagArray.splice(0,1);
for (t in tagArray) {
if(tagArray[t] != '') {
select(tagArray[t])
tagHash[tagArray[t]] = true
}}
for (t in selected) {if (!tagHash[t]) deselect(t)}
return [tagArray, tagHash]
}
function hideSuggestions() {h.suggest.parentNode.style.visibility='hidden'}
function showSuggestions() { suggest(0); h.suggest.parentNode.style.visibility='visible'}
function updateSuggestions() {
if(!getCurrentTag() || !currentTag.text) { hideSuggestions(); return false }
while (h.suggest.hasChildNodes()) h.suggest.removeChild(h.suggest.firstChild)
delete suggestions; suggestions = new Suggestions();
var tagArray = h.newTags.value.toLowerCase().split(' '), txt=currentTag.text.escRegExp(), tagHash={}, t
for(t in tagArray) tagHash[tagArray[t]] = true
var search = tagSearch.match(new RegExp(("\s("+txt+"[^\s]+)\s"), "gi"))
if(search){
for (i=0; i tl = search[i].trim() if(tagHash[tl]) continue // do not suggest already typed tag suggestions[suggestions.length] = makeTag(h.suggest, tl, 'complete') suggestions.length++ }} if (suggestions.length > 0) showSuggestions() else hideSuggestions() } function suggest(index) { if(suggestions.length == 1) index = 0 if(suggestions[suggestions.picked]) suggestions[suggestions.picked].className = ‘tag’ suggestions[suggestions.picked = index].className = ‘tag selected’ } function getCurrentTag() { if(h.newTags.value == lastEdit) return true // no edit if(h.newTags == ”) return false currentTag = {} var tagArray=h.newTags.value.toLowerCase().split(’ ‘), oldArray=lastEdit.toLowerCase().split(’ ‘), currentTags = [], matched=false, t,o for (t in tagArray) { for (o in oldArray) { if(typeof oldArray[o] == ‘undefined’) { oldArray.splice(o,1); break } if(tagArray[t] == oldArray[o]) { matched = true; oldArray.splice(o,1); break; } } if(!matched) currentTags[currentTags.length] = t matched=false } // more than one word changed… abort if(currentTags.length > 1) { hideSuggestions(); return false } currentTag = { text:tagArray[currentTags[0]], index:currentTags[0] } return true } function handler(event) { var e=(event||window.event) //w3||ie if (e.type == ‘keydown’) { if(suggestions.length > 0) { switch(e.keyCode) { case 38: suggest((suggestions.picked + 1) % suggestions.length); break case 40: suggest(suggestions.picked == 0 ? suggestions.length - 1 : suggestions.picked - 1); break }}} else if (e.type == ‘keypress’) { switch(e.keyCode){ case 38: case 40: if(e.preventDefault) e.preventDefault() //ff break; case 9: // tab if (e.preventDefault && h.suggest.parentNode.style.visibility == ‘visible’) { //ff complete() e.preventDefault() } break; default: lastEdit = h.newTags.value }} else if (e.type == ‘keyup’) { updateHilight() switch(e.keyCode) { //case 8: //backspace //case 46: //delete case 35: //end case 36: //home case 39: // right case 37: // left case 32: // space hideSuggestions(); break case 38: case 40: break; case 9: if(!e.preventDefault && h.suggest.parentNode.style.visibility == ‘visible’) complete() //ie break; default: updateSuggestions() }}}
Many people have asked for a way to do address completion using Ctrl+Enter a la IE. Well, thanks to the investigative work of Lee Harvey, Steven V. Gunhouse, and Lauri Raittila from the Opera newsgroups, we now have a good way to do this.
In the keyboard editor, go to the Document window section and add a new shortcut for “enter ctrl”. Then, enter the command
Now, this shouldn’t interfere with Wand, as long as focus is in the address bar.
You can also add commands for other address endings, like .net, .org, .co.uk, etc. Enjoy!
相关资料:
http://weblog.timaltman.com/node/750?PHPSESSID=a7416a2b3e7c78e02f14873cf9fde2db
http://groups-beta.google.com/group/opera.customize.general/msg/54d4232a26751d4e?safe=images&as_umsgid=cq6icn%24iiq%241@mx1.opera.com&lr=lang_en&hl=en
Well, it’s that time again. Here are my favorite changes in Opera 8.0 Beta 3:
SVG 1.1 Tiny support. Need I say more?
All protocols can be redirected to other applications. IRC://, NNTP://, and news:// URLs can now be set to open with other applications. And, if you run a standalone Opera Mail installation, hxxp:// and hxxps:// URLs can be redirected to your browser installation![1]
The “Title” setting in the [User Prefs] section of opera6.ini can now contain a “%t” variable, which will be the page title. In other words, you can set the order that information appears in the Title bar. If you want the Opera build number first, use something like “Title=Opera 8.0.%s - %t”. If “%t” is left out, the title will show before the custom Title setting.
Save attachments dialog. At long last, you can save multiple attachments to messages quickly. There are still several rough spots in attachment handling, but things are definitely getting better.
The bug where “$” couldn’t be used in search strings is fixed. I do a lot of message-id searches in Google Groups, which often triggered this bug. It’s so nice to have one more annoyance gone.
Improved collapsed address bar. If a page opens a pop-up without an address bar, the pop-up will now have a small bar at the top that shows the hostname and security information (if any) for the page. I’m starting to wish that it worked on all pages, not just pop-ups.
Various prototype objects are now available to scripts. I really don’t know what this means, but some of our testers were pretty excited about it.
Better form styling. We fixed a couple of bugs with the way form elements are styled, so things are working better and are more consistent with other browsers.
Display notifiers immediately if special effects are turned off. If you’re annoyed by the slow rising and falling of the notification dialogs, but still want to know when stuff is happening, you can disable skin special effects[2] and notifications show briefly, then vanish without all the scrolling.
New preferences dialog. The new dialog has better organization and will probably be less daunting for new users. Some stuff that should have stayed didn’t, though.
[1] Admittedly, there’s a slight problem with this: if you open a link from an e-mail, a blank page is still opened even if the link is sent to another application. So, it may not be a complete solution yet, but it’s a large step in the right direction.
[2] Unfortunately, that setting is currently only available by messing with opera6.ini. Set “Special effects=0″ in the [User Prefs] section of opera6.ini to try it out. Note that this setting affects some skin styles, too.
from:
http://weblog.timaltman.com/node/760?PHPSESSID=a7416a2b3e7c78e02f14873cf9fde2db