设计

垃圾文章凑合着看很一般还不错精品 (暂时没有评价)
Loading ... Loading ...

对发展中国家来说,包括中国和印度,应该提倡为金字塔的底层(穷人)而设计, 这个洁水器的设计就是典型的代表:

-

这个看上去像个锥形的东东使用起来很简单:

1. 将需要洁净的水(比如海水)倒入底盖

2. 在太阳下晒24小时

3. 将顶盖边缘储留的蒸汽水倒入瓶中即可饮用。

Optimus 的键盘设计,还未上市就已疯狂

每一个键都是一个小屏幕,显示当下的操作。 当前使用的软件也会显示,方便用户转换。


Peter Callesen的纸雕
-

可乐发表于:12-18-07

input弹出选择框制作方法

垃圾文章凑合着看很一般还不错精品 (暂时没有评价)
Loading ... Loading ...

今天接触到的一个东西,JS代码部分看的实在是头大。列出来希望能对大家有所帮助。

代码很长,估计没人会去细读。

不会写JS的前台不是好前台。可我就是一个JS无比烂的前台。。。哭死过去

HTML Body部分

城 市<br />
<input name=”locc” id=”loc_txt” type=”text” class=”input1″ onFocus=”javascript:clearDF(this);showlib(this,_lib_city,350,4,’center’);return false” helptext=”请选择城市” onBlur=”hiddenlibpop(this);showDF(this)”/><br />请选择城市

head区调用代码

<script language=”javascript” src=”http://www.chaoketu.com/common.js”></script>
<script language=”javascript” src=”http://www.chaoketu.com/popup.js”></script>
<script language=”javascript” src=”http://www.chaoketu.com/search_pop_data.js”></script>

JS代码

common.js(主要用来控制Cookie)

/*
* Cookie的操作
* 在ie和moz中可运行
*/
function Cookie(tran){
this.tran=tran;
this.setValue=function(name,value,hours,path,domain,secure){
var str=new String();
var nextTime=new Date();
nextTime.setHours(nextTime.getHours()+hours);
var val=this.tran==true?escape(value):value;
str=name+”=”+val;
if(hours){
str+=”;expires=”+nextTime.toGMTString();}
if(path){
str+=”;path=”+path;}
if(domain){
str+=”;domain=”+domain;}
if(secure){
str+=”;secure”;}
document.cookie=str;
};
this.getValue=function(name){
var rs=new RegExp(”(^|)”+name+”=([^;]*)(;|$)”,”gi”).exec(document.cookie),tmp;
if(tmp=rs){
return this.tran==true?unescape(tmp[2]):(tmp[2]);}
return null;
}
}
function hidobj(objid){
var obj =document.getElementById(objid);
if(obj){
obj.style.display=”none”;
}
}
function displayobj(objid){
var obj =document.getElementById(objid);
if(obj){obj.style.display=”";}
}
/**
* COMMON DHTML FUNCTIONS
* These are handy functions I use all the time.
*
* By Seth Banks (webmaster at subimage dot com)
* http://www.subimage.com/
*
* Up to date code can be found at http://www.subimage.com/dhtml/
*
* This code is free for you to use anywhere, just keep this comment block.
*/

/**
* X-browser event handler attachment and detachment
* TH: Switched first true to false per http://www.onlinetools.org/articles/unobtrusivejavascript/chapter4.html
*
* @argument obj - the object to attach event to
* @argument evType - name of the event - DONT ADD “on”, pass only “mouseover”, etc
* @argument fn - function to call
*/
function addEvent(obj, evType, fn){
if (obj.addEventListener){
obj.addEventListener(evType, fn, false);
return true;
} else if (obj.attachEvent){
var r = obj.attachEvent(”on”+evType, fn);
return r;
} else {
return false;
}
}
function removeEvent(obj, evType, fn, useCapture){
if (obj.removeEventListener){
obj.removeEventListener(evType, fn, useCapture);
return true;
} else if (obj.detachEvent){
var r = obj.detachEvent(”on”+evType, fn);
return r;
} else {
alert(”Handler could not be removed”);
}
}

/**
* Code below taken from - http://www.evolt.org/article/document_body_doctype_switching_and_more/17/30655/
*
* Modified 4/22/04 to work with Opera/Moz (by webmaster at subimage dot com)
*
* Gets the full width/height because it’s different for most browsers.
*/
function getViewportHeight() {
if (window.innerHeight!=window.undefined){ return window.innerHeight;}
if (document.compatMode==’http://www.chaoketu.com/CSS1Compat’) {return document.documentElement.clientHeight;}
if (document.body) {return document.body.clientHeight; }
return window.undefined;
}
function getViewportWidth() {
if (window.innerWidth!=window.undefined){ return window.innerWidth; }
if (document.compatMode==’CSS1Compat’){ return document.documentElement.clientWidth; }
if (document.body){ return document.body.clientWidth; }
return window.undefined;
}
/*————————————————————————–*/
/* Prototype JavaScript framework, version 1.4.0
* (c) 2005 Sam Stephenson <sam@conio.net>
*
* Prototype is freely distributable under the terms of an MIT-style license.
* For details, see the Prototype web site: http://prototype.conio.net/
*
/*————————————————————————–*/

var Prototype = {
Version: ‘1.4.0′,
ScriptFragment: ‘(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)’,

emptyFunction: function() {},
K: function(x) {return x}
}

var Class = {
create: function() {
return function() {
this.initialize.apply(this, arguments);
}
}
}

var Abstract = new Object();

Object.extend = function(destination, source) {
for (property in source) {
destination[property] = source[property];
}
return destination;
}

Object.inspect = function(object) {
try {
if (object == undefined) return ‘undefined’;
if (object == null) return ‘null’;
return object.inspect ? object.inspect() : object.toString();
} catch (e) {
if (e instanceof RangeError) return ‘…’;
throw e;
}
}

Function.prototype.bind = function() {
var __method = this, args = $A(arguments), object = args.shift();
return function() {
return __method.apply(object, args.concat($A(arguments)));
}
}

Function.prototype.bindAsEventListener = function(object) {
var __method = this;
return function(event) {
return __method.call(object, event || window.event);
}
}

Object.extend(Number.prototype, {
toColorPart: function() {
var digits = this.toString(16);
if (this < 16) return ‘0′ + digits;
return digits;
},

succ: function() {
return this + 1;
},

times: function(iterator) {
$R(0, this, true).each(iterator);
return this;
}
});

var Try = {
these: function() {
var returnValue;

for (var i = 0; i < arguments.length; i++) {
var lambda = arguments[i];
try {
returnValue = lambda();
break;
} catch (e) {}
}

return returnValue;
}
}

/*————————————————————————–*/

var PeriodicalExecuter = Class.create();
PeriodicalExecuter.prototype = {
initialize: function(callback, frequency) {
this.callback = callback;
this.frequency = frequency;
this.currentlyExecuting = false;

this.registerCallback();
},

registerCallback: function() {
setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
},

onTimerEvent: function() {
if (!this.currentlyExecuting) {
try {
this.currentlyExecuting = true;
this.callback();
} finally {
this.currentlyExecuting = false;
}
}
}
}

/*————————————————————————–*/

function $() {
var elements = new Array();

for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof element == ’string’)

element = document.getElementById(element);

if (arguments.length == 1)
return element;

elements.push(element);
}

return elements;
}
Object.extend(String.prototype, {
stripTags: function() {
return this.replace(/<\/?[^>]+>/gi, ”);
},

stripScripts: function() {
return this.replace(new RegExp(Prototype.ScriptFragment, ‘img’), ”);
},

extractScripts: function() {
var matchAll = new RegExp(Prototype.ScriptFragment, ‘img’);
var matchOne = new RegExp(Prototype.ScriptFragment, ‘im’);
return (this.match(matchAll) || []).map(function(scriptTag) {
return (scriptTag.match(matchOne) || ['', ''])[1];
});
},

evalScripts: function() {
return this.extractScripts().map(eval);
},

escapeHTML: function() {
var div = document.createElement(’div’);
var text = document.createTextNode(this);
div.appendChild(text);
return div.innerHTML;
},

unescapeHTML: function() {
var div = document.createElement(’div’);
div.innerHTML = this.stripTags();
return div.childNodes[0] ? div.childNodes[0].nodeValue : ”;
},

toQueryParams: function() {
var pairs = this.match(/^\??(.*)$/)[1].split(’&’);
return pairs.inject({}, function(params, pairString) {
var pair = pairString.split(’=');
params[pair[0]] = pair[1];
return params;
});
},

toArray: function() {
return this.split(”);
},

camelize: function() {
var oStringList = this.split(’-');
if (oStringList.length == 1) return oStringList[0];

var camelizedString = this.indexOf(’-') == 0
? oStringList[0].charAt(0).toUpperCase() + oStringList[0].substring(1)
: oStringList[0];

for (var i = 1, len = oStringList.length; i < len; i++) {
var s = oStringList[i];
camelizedString += s.charAt(0).toUpperCase() + s.substring(1);
}

return camelizedString;
},

inspect: function() {
return “‘” + this.replace(’\\’, ‘\\\\’).replace(”‘”, ‘\\\”) + “‘”;
}
});

String.prototype.parseQuery = String.prototype.toQueryParams;

var $break = new Object();
var $continue = new Object();

var Enumerable = {
each: function(iterator) {
var index = 0;
try {
this._each(function(value) {
try {
iterator(value, index++);
} catch (e) {
if (e != $continue) throw e;
}
});
} catch (e) {
if (e != $break) throw e;
}
},
all: function(iterator) {
var result = true;
this.each(function(value, index) {
result = result && !!(iterator || Prototype.K)(value, index);
if (!result) throw $break;
});
return result;
},

any: function(iterator) {
var result = true;
this.each(function(value, index) {
if (result = !!(iterator || Prototype.K)(value, index))
throw $break;
});
return result;
},

collect: function(iterator) {
var results = [];
this.each(function(value, index) {
results.push(iterator(value, index));
});
return results;
},

detect: function (iterator) {
var result;
this.each(function(value, index) {
if (iterator(value, index)) {
result = value;
throw $break;
}
});
return result;
},

findAll: function(iterator) {
var results = [];
this.each(function(value, index) {
if (iterator(value, index))
results.push(value);
});
return results;
},

grep: function(pattern, iterator) {
var results = [];
this.each(function(value, index) {
var stringValue = value.toString();
if (stringValue.match(pattern))
results.push((iterator || Prototype.K)(value, index));
})
return results;
},

include: function(object) {
var found = false;
this.each(function(value) {
if (value == object) {
found = true;
throw $break;
}
});
return found;
},

inject: function(memo, iterator) {
this.each(function(value, index) {
memo = iterator(memo, value, index);
});
return memo;
},

invoke: function(method) {
var args = $A(arguments).slice(1);
return this.collect(function(value) {
return value[method].apply(value, args);
});
},

max: function(iterator) {
var result;
this.each(function(value, index) {
value = (iterator || Prototype.K)(value, index);
if (value >= (result || value))
result = value;
});
return result;
},

min: function(iterator) {
var result;
this.each(function(value, index) {
value = (iterator || Prototype.K)(value, index);
if (value <= (result || value))
result = value;
});
return result;
},

partition: function(iterator) {
var trues = [], falses = [];
this.each(function(value, index) {
((iterator || Prototype.K)(value, index) ?
trues : falses).push(value);
});
return [trues, falses];
},

pluck: function(property) {
var results = [];
this.each(function(value, index) {
results.push(value[property]);
});
return results;
},

reject: function(iterator) {
var results = [];
this.each(function(value, index) {
if (!iterator(value, index))
results.push(value);
});
return results;
},

sortBy: function(iterator) {
return this.collect(function(value, index) {
return {value: value, criteria: iterator(value, index)};
}).sort(function(left, right) {
var a = left.criteria, b = right.criteria;
return a < b ? -1 : a > b ? 1 : 0;
}).pluck(’value’);
},

toArray: function() {
return this.collect(Prototype.K);
},

zip: function() {
var iterator = Prototype.K, args = $A(arguments);
if (typeof args.last() == ‘function’)
iterator = args.pop();

var collections = [this].concat(args).map($A);
return this.map(function(value, index) {
iterator(value = collections.pluck(index));
return value;
});
},

inspect: function() {
return ‘#<Enumerable:’ + this.toArray().inspect() + ‘>’;
}
}

Object.extend(Enumerable, {
map: Enumerable.collect,
find: Enumerable.detect,
select: Enumerable.findAll,
member: Enumerable.include,
entries: Enumerable.toArray
});
var $A = Array.from = function(iterable) {
if (!iterable) return [];
if (iterable.toArray) {
return iterable.toArray();
} else {
var results = [];
for (var i = 0; i < iterable.length; i++)
results.push(iterable[i]);
return results;
}
}

Object.extend(Array.prototype, Enumerable);

Array.prototype._reverse = Array.prototype.reverse;

Object.extend(Array.prototype, {
_each: function(iterator) {
for (var i = 0; i < this.length; i++)
iterator(this[i]);
},

clear: function() {
this.length = 0;
return this;
},

first: function() {
return this[0];
},

last: function() {
return this[this.length - 1];
},

compact: function() {
return this.select(function(value) {
return value != undefined || value != null;
});
},

flatten: function() {
return this.inject([], function(array, value) {
return array.concat(value.constructor == Array ?
value.flatten() : [value]);
});
},

without: function() {
var values = $A(arguments);
return this.select(function(value) {
return !values.include(value);
});
},

indexOf: function(object) {
for (var i = 0; i < this.length; i++)
if (this[i] == object) return i;
return -1;
},

reverse: function(inline) {
return (inline !== false ? this : this.toArray())._reverse();
},

shift: function() {
var result = this[0];
for (var i = 0; i < this.length - 1; i++)
this[i] = this[i + 1];
this.length–;
return result;
},

inspect: function() {
return ‘[' + this.map(Object.inspect).join(', ') + ']‘;
}
});
var Hash = {
_each: function(iterator) {
for (key in this) {
var value = this[key];
if (typeof value == ‘function’) continue;

var pair = [key, value];
pair.key = key;
pair.value = value;
iterator(pair);
}
},

keys: function() {
return this.pluck(’key’);
},

values: function() {
return this.pluck(’value’);
},

merge: function(hash) {
return $H(hash).inject($H(this), function(mergedHash, pair) {
mergedHash[pair.key] = pair.value;
return mergedHash;
});
},

toQueryString: function() {
return this.map(function(pair) {
return pair.map(encodeURIComponent).join(’=');
}).join(’&’);
},

inspect: function() {
return ‘#<Hash:{’ + this.map(function(pair) {
return pair.map(Object.inspect).join(’: ‘);
}).join(’, ‘) + ‘}>’;
}
}

function $H(object) {
var hash = Object.extend({}, object || {});
Object.extend(hash, Enumerable);
Object.extend(hash, Hash);
return hash;
}
ObjectRange = Class.create();
Object.extend(ObjectRange.prototype, Enumerable);
Object.extend(ObjectRange.prototype, {
initialize: function(start, end, exclusive) {
this.start = start;
this.end = end;
this.exclusive = exclusive;
},

_each: function(iterator) {
var value = this.start;
do {
iterator(value);
value = value.succ();
} while (this.include(value));
},

include: function(value) {
if (value < this.start)
return false;
if (this.exclusive)
return value < this.end;
return value <= this.end;
}
});

var $R = function(start, end, exclusive) {
return new ObjectRange(start, end, exclusive);
}

if (!window.Element) {
var Element = new Object();
}

Object.extend(Element, {
visible: function(element) {
return $(element).style.display != ‘none’;
},

toggle: function() {
for (var i = 0; i < arguments.length; i++) {
var element = $(arguments[i]);
Element[Element.visible(element) ? 'hide' : 'show'](element);
}
},

hide: function() {
for (var i = 0; i < arguments.length; i++) {
var element = $(arguments[i]);
element.style.display = ‘none’;
}
},

show: function() {
for (var i = 0; i < arguments.length; i++) {
var element = $(arguments[i]);
element.style.display = ”;
}
},

remove: function(element) {
element = $(element);
element.parentNode.removeChild(element);
},

update: function(element, html) {
$(element).innerHTML = html.stripScripts();
setTimeout(function() {html.evalScripts()}, 10);
},

getHeight: function(element) {
element = $(element);
return element.offsetHeight;
},

classNames: function(element) {
return new Element.ClassNames(element);
},

hasClassName: function(element, className) {
if (!(element = $(element))) return;
return Element.classNames(element).include(className);
},

addClassName: function(element, className) {
if (!(element = $(element))) return;
return Element.classNames(element).add(className);
},

removeClassName: function(element, className) {
if (!(element = $(element))) return;
return Element.classNames(element).remove(className);
},

// removes whitespace-only text node children
cleanWhitespace: function(element) {
element = $(element);
for (var i = 0; i < element.childNodes.length; i++) {
var node = element.childNodes[i];
if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
Element.remove(node);
}
},

empty: function(element) {
return $(element).innerHTML.match(/^\s*$/);
},

scrollTo: function(element) {
element = $(element);
var x = element.x ? element.x : element.offsetLeft,
y = element.y ? element.y : element.offsetTop;
window.scrollTo(x, y);
},

getStyle: function(element, style) {
element = $(element);
var value = element.style[style.camelize()];
if (!value) {
if (document.defaultView && document.defaultView.getComputedStyle) {
var css = document.defaultView.getComputedStyle(element, null);
value = css ? css.getPropertyValue(style) : null;
} else if (element.currentStyle) {
value = element.currentStyle[style.camelize()];
}
}

if (window.opera && ['left', 'top', 'right', 'bottom'].include(style))
if (Element.getStyle(element, ‘position’) == ’static’) value = ‘auto’;

return value == ‘auto’ ? null : value;
},

setStyle: function(element, style) {
element = $(element);
for (name in style)
element.style[name.camelize()] = style[name];
},

getDimensions: function(element) {
element = $(element);
if (Element.getStyle(element, ‘display’) != ‘none’)
return {width: element.offsetWidth, height: element.offsetHeight};

// All *Width and *Height properties give 0 on elements with display none,
// so enable the element temporarily
var els = element.style;
var originalVisibility = els.visibility;
var originalPosition = els.position;
els.visibility = ‘hidden’;
els.position = ‘absolute’;
els.display = ”;
var originalWidth = element.clientWidth;
var originalHeight = element.clientHeight;
els.display = ‘none’;
els.position = originalPosition;
els.visibility = originalVisibility;
return {width: originalWidth, height: originalHeight};
},

makePositioned: function(element) {
element = $(element);
var pos = Element.getStyle(element, ‘position’);
if (pos == ’static’ || !pos) {
element._madePositioned = true;
element.style.position = ‘relative’;
// Opera returns the offset relative to the positioning context, when an
// element is position relative but top and left have not been defined
if (window.opera) {
element.style.top = 0;
element.style.left = 0;
}
}
},

undoPositioned: function(element) {
element = $(element);
if (element._madePositioned) {
element._madePositioned = undefined;
element.style.position =
element.style.top =
element.style.left =
element.style.bottom =
element.style.right = ”;
}
},

makeClipping: function(element) {
element = $(element);
if (element._overflow) return;
element._overflow = element.style.overflow;
if ((Element.getStyle(element, ‘overflow’) || ‘visible’) != ‘hidden’)
element.style.overflow = ‘hidden’;
},

undoClipping: function(element) {
element = $(element);
if (element._overflow) return;
element.style.overflow = element._overflow;
element._overflow = undefined;
}
});

var Toggle = new Object();
Toggle.display = Element.toggle;

/*————————————————————————–*/

Abstract.Insertion = function(adjacency) {
this.adjacency = adjacency;
}

Abstract.Insertion.prototype = {
initialize: function(element, content) {
this.element = $(element);
this.content = content.stripScripts();

if (this.adjacency && this.element.insertAdjacentHTML) {
try {
this.element.insertAdjacentHTML(this.adjacency, this.content);
} catch (e) {
if (this.element.tagName.toLowerCase() == ‘tbody’) {
this.insertContent(this.contentFromAnonymousTable());
} else {
throw e;
}
}
} else {
this.range = this.element.ownerDocument.createRange();
if (this.initializeRange) this.initializeRange();
this.insertContent([this.range.createContextualFragment(this.content)]);
}

setTimeout(function() {content.evalScripts()}, 10);
},

contentFromAnonymousTable: function() {
var div = document.createElement(’div’);
div.innerHTML = ‘<table><tbody>’ + this.content + ‘</tbody></table>’;
return $A(div.childNodes[0].childNodes[0].childNodes);
}
}

var Insertion = new Object();

Insertion.Before = Class.create();
Insertion.Before.prototype = Object.extend(new Abstract.Insertion(’beforeBegin’), {
initializeRange: function() {
this.range.setStartBefore(this.element);
},

insertContent: function(fragments) {
fragments.each((function(fragment) {
this.element.parentNode.insertBefore(fragment, this.element);
}).bind(this));
}
});

Insertion.Top = Class.create();
Insertion.Top.prototype = Object.extend(new Abstract.Insertion(’afterBegin’), {
initializeRange: function() {
this.range.selectNodeContents(this.element);
this.range.collapse(true);
},

insertContent: function(fragments) {
fragments.reverse(false).each((function(fragment) {
this.element.insertBefore(fragment, this.element.firstChild);
}).bind(this));
}
});

Insertion.Bottom = Class.create();
Insertion.Bottom.prototype = Object.extend(new Abstract.Insertion(’beforeEnd’), {
initializeRange: function() {
this.range.selectNodeContents(this.element);
this.range.collapse(this.element);
},

insertContent: function(fragments) {
fragments.each((function(fragment) {
this.element.appendChild(fragment);
}).bind(this));
}
});

Insertion.After = Class.create();
Insertion.After.prototype = Object.extend(new Abstract.Insertion(’afterEnd’), {
initializeRange: function() {
this.range.setStartAfter(this.element);
},

insertContent: function(fragments) {
fragments.each((function(fragment) {
this.element.parentNode.insertBefore(fragment,
this.element.nextSibling);
}).bind(this));
}
});

/*————————————————————————–*/

Element.ClassNames = Class.create();
Element.ClassNames.prototype = {
initialize: function(element) {
this.element = $(element);
},

_each: function(iterator) {
this.element.className.split(/\s+/).select(function(name) {
return name.length > 0;
})._each(iterator);
},

set: function(className) {
this.element.className = className;
},

add: function(classNameToAdd) {
if (this.include(classNameToAdd)) return;
this.set(this.toArray().concat(classNameToAdd).join(’ ‘));
},

remove: function(classNameToRemove) {
if (!this.include(classNameToRemove)) return;
this.set(this.select(function(className) {
return className != classNameToRemove;
}).join(’ ‘));
},

toString: function() {
return this.toArray().join(’ ‘);
}
}

Object.extend(Element.ClassNames.prototype, Enumerable);
var Field = {
clear: function() {
for (var i = 0; i < arguments.length; i++)
$(arguments[i]).value = ”;
},

focus: function(element) {
$(element).focus();
},

present: function() {
for (var i = 0; i < arguments.length; i++)
if ($(arguments[i]).value == ”) return false;
return true;
},

select: function(element) {
$(element).select();
},

activate: function(element) {
element = $(element);
element.focus();
if (element.select)
element.select();
}
}

/*————————————————————————–*/

var Form = {
serialize: function(form) {
var elements = Form.getElements($(form));
var queryComponents = new Array();

for (var i = 0; i < elements.length; i++) {
var queryComponent = Form.Element.serialize(elements[i]);
if (queryComponent)
queryComponents.push(queryComponent);
}

return queryComponents.join(’&’);
},

getElements: function(form) {
form = $(form);
var elements = new Array();

for (tagName in Form.Element.Serializers) {
var tagElements = form.getElementsByTagName(tagName);
for (var j = 0; j < tagElements.length; j++)
elements.push(tagElements[j]);
}
return elements;
},

getInputs: function(form, typeName, name) {
form = $(form);
var inputs = form.getElementsByTagName(’input’);

if (!typeName && !name)
return inputs;

var matchingInputs = new Array();
for (var i = 0; i < inputs.length; i++) {
var input = inputs[i];
if ((typeName && input.type != typeName) ||
(name && input.name != name))
continue;
matchingInputs.push(input);
}

return matchingInputs;
},

disable: function(form) {
var elements = Form.getElements(form);
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
element.blur();
element.disabled = ‘true’;
}
},

enable: function(form) {
var elements = Form.getElements(form);
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
element.disabled = ”;
}
},

findFirstElement: function(form) {
return Form.getElements(form).find(function(element) {
return element.type != ‘hidden’ && !element.disabled &&
['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
});
},

focusFirstElement: function(form) {
Field.activate(Form.findFirstElement(form));
},

reset: function(form) {
$(form).reset();
}
}

Form.Element = {
serialize: function(element) {
element = $(element);
var method = element.tagName.toLowerCase();
var parameter = Form.Element.Serializers[method](element);

if (parameter) {
var key = encodeURIComponent(parameter[0]);
if (key.length == 0) return;

if (parameter[1].constructor != Array)
parameter[1] = [parameter[1]];

return parameter[1].map(function(value) {
return key + ‘=’ + encodeURIComponent(value);
}).join(’&’);
}
},

getValue: function(element) {
element = $(element);
var method = element.tagName.toLowerCase();
var parameter = Form.Element.Serializers[method](element);

if (parameter)
return parameter[1];
}
}

Form.Element.Serializers = {
input: function(element) {
switch (element.type.toLowerCase()) {
case ’submit’:
case ‘hidden’:
case ‘password’:
case ‘text’:
return Form.Element.Serializers.textarea(element);
case ‘checkbox’:
case ‘radio’:
return Form.Element.Serializers.inputSelector(element);
}
return false;
},

inputSelector: function(element) {
if (element.checked)
return [element.name, element.value];
},

textarea: function(element) {
return [element.name, element.value];
},

select: function(element) {
return Form.Element.Serializers[element.type == 'select-one' ?
'selectOne' : 'selectMany'](element);
},

selectOne: function(element) {
var value = ”, opt, index = element.selectedIndex;
if (index >= 0) {
opt = element.options[index];
value = opt.value;
if (!value && !(’value’ in opt))
value = opt.text;
}
return [element.name, value];
},

selectMany: function(element) {
var value = new Array();
for (var i = 0; i < element.length; i++) {
var opt = element.options[i];
if (opt.selected) {
var optValue = opt.value;
if (!optValue && !(’value’ in opt))
optValue = opt.text;
value.push(optValue);
}
}
return [element.name, value];
}
}

/*————————————————————————–*/

var $F = Form.Element.getValue;

/*————————————————————————–*/

Abstract.TimedObserver = function() {}
Abstract.TimedObserver.prototype = {
initialize: function(element, frequency, callback) {
this.frequency = frequency;
this.element = $(element);
this.callback = callback;

this.lastValue = this.getValue();
this.registerCallback();
},

registerCallback: function() {
setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
},

onTimerEvent: function() {
var value = this.getValue();
if (this.lastValue != value) {
this.callback(this.element, value);
this.lastValue = value;
}
}
}

Form.Element.Observer = Class.create();
Form.Element.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
getValue: function() {
return Form.Element.getValue(this.element);
}
});

Form.Observer = Class.create();
Form.Observer.prototype = Object.extend(new Abstract.TimedObserver(), {
getValue: function() {
return Form.serialize(this.element);
}
});

/*————————————————————————–*/

Abstract.EventObserver = function() {}
Abstract.EventObserver.prototype = {
initialize: function(element, callback) {
this.element = $(element);
this.callback = callback;

this.lastValue = this.getValue();
if (this.element.tagName.toLowerCase() == ‘form’)
this.registerFormCallbacks();
else
this.registerCallback(this.element);
},

onElementEvent: function() {
var value = this.getValue();
if (this.lastValue != value) {
this.callback(this.element, value);
this.lastValue = value;
}
},

registerFormCallbacks: function() {
var elements = Form.getElements(this.element);
for (var i = 0; i < elements.length; i++)
this.registerCallback(elements[i]);
},

registerCallback: function(element) {
if (element.type) {
switch (element.type.toLowerCase()) {
case ‘checkbox’:
case ‘radio’:
Event.observe(element, ‘click’, this.onElementEvent.bind(this));
break;
case ‘password’:
case ‘text’:
case ‘textarea’:
case ’select-one’:
case ’select-multiple’:
Event.observe(element, ‘change’, this.onElementEvent.bind(this));
break;
}
}
}
}

Form.Element.EventObserver = Class.create();
Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
getValue: function() {
return Form.Element.getValue(this.element);
}
});

Form.EventObserver = Class.create();
Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), {
getValue: function() {
return Form.serialize(this.element);
}
});
if (!window.Event) {
var Event = new Object();
}

Object.extend(Event, {
KEY_BACKSPACE: 8,
KEY_TAB: 9,
KEY_RETURN: 13,
KEY_ESC: 27,
KEY_LEFT: 37,
KEY_UP: 38,
KEY_RIGHT: 39,
KEY_DOWN: 40,
KEY_DELETE: 46,

element: function(event) {
return event.target || event.srcElement;
},

isLeftClick: function(event) {
return (((event.which) && (event.which == 1)) ||
((event.button) && (event.button == 1)));
},

pointerX: function(event) {
return event.pageX || (event.clientX +
(document.documentElement.scrollLeft || document.body.scrollLeft));
},

pointerY: function(event) {
return event.pageY || (event.clientY +
(document.documentElement.scrollTop || document.body.scrollTop));
},

stop: function(event) {
if (event.preventDefault) {
event.preventDefault();
event.stopPropagation();
} else {
event.returnValue = false;
event.cancelBubble = true;
}
},

// find the first node with the given tagName, starting from the
// node the event was triggered on; traverses the DOM upwards
findElement: function(event, tagName) {
var element = Event.element(event);
while (element.parentNode && (!element.tagName ||
(element.tagName.toUpperCase() != tagName.toUpperCase())))
element = element.parentNode;
return element;
},

observers: false,

_observeAndCache: function(element, name, observer, useCapture) {
if (!this.observers) this.observers = [];
if (element.addEventListener) {
this.observers.push([element, name, observer, useCapture]);
element.addEventListener(name, observer, useCapture);
} else if (element.attachEvent) {
this.observers.push([element, name, observer, useCapture]);
element.attachEvent(’on’ + name, observer);
}
},

unloadCache: function() {
if (!Event.observers) return;
for (var i = 0; i < Event.observers.length; i++) {
Event.stopObserving.apply(this, Event.observers[i]);
Event.observers[i][0] = null;
}
Event.observers = false;
},

observe: function(element, name, observer, useCapture) {
var element = $(element);
useCapture = useCapture || false;

if (name == ‘keypress’ &&
(navigator.appVersion.match(/Konqueror|Safari|KHTML/)
|| element.attachEvent))
name = ‘keydown’;

this._observeAndCache(element, name, observer, useCapture);
},

stopObserving: function(element, name, observer, useCapture) {
var element = $(element);
useCapture = useCapture || false;

if (name == ‘keypress’ &&
(navigator.appVersion.match(/Konqueror|Safari|KHTML/)
|| element.detachEvent))
name = ‘keydown’;

if (element.removeEventListener) {
element.removeEventListener(name, observer, useCapture);
} else if (element.detachEvent) {
element.detachEvent(’on’ + name, observer);
}
}
});

/* prevent memory leaks in IE */
Event.observe(window, ‘unload’, Event.unloadCache, false);
var Position = {
// set to true if needed, warning: firefox performance problems
// NOT neeeded for page scrolling, only if draggable contained in
// scrollable elements
includeScrollOffsets: false,

// must be called before calling withinIncludingScrolloffset, every time the
// page is scrolled
prepare: function() {
this.deltaX = window.pageXOffset
|| document.documentElement.scrollLeft
|| document.body.scrollLeft
|| 0;
this.deltaY = window.pageYOffset
|| document.documentElement.scrollTop
|| document.body.scrollTop
|| 0;
},

realOffset: function(element) {
var valueT = 0, valueL = 0;
do {
valueT += element.scrollTop || 0;
valueL += element.scrollLeft || 0;
element = element.parentNode;
} while (element);
return [valueL, valueT];
},

cumulativeOffset: function(element) {
var valueT = 0, valueL = 0;
do {
valueT += element.offsetTop || 0;
valueL += element.offsetLeft || 0;
element = element.offsetParent;
} while (element);
return [valueL, valueT];
},

positionedOffset: function(element) {
var valueT = 0, valueL = 0;
do {
valueT += element.offsetTop || 0;
valueL += element.offsetLeft || 0;
element = element.offsetParent;
if (element) {
p = Element.getStyle(element, ‘position’);
if (p == ‘relative’ || p == ‘absolute’) break;
}
} while (element);
return [valueL, valueT];
},

offsetParent: function(element) {
if (element.offsetParent) return element.offsetParent;
if (element == document.body) return element;

while ((element = element.parentNode) && element != document.body)
if (Element.getStyle(element, ‘position’) != ’static’)
return element;

return document.body;
},

// caches x/y coordinate pair to use with overlap
within: function(element, x, y) {
if (this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element, x, y);
this.xcomp = x;
this.ycomp = y;
this.offset = this.cumulativeOffset(element);

return (y >= this.offset[1] &&
y < this.offset[1] + element.offsetHeight &&
x >= this.offset[0] &&
x < this.offset[0] + element.offsetWidth);
},

withinIncludingScrolloffsets: function(element, x, y) {
var offsetcache = this.realOffset(element);

this.xcomp = x + offsetcache[0] - this.deltaX;
this.ycomp = y + offsetcache[1] - this.deltaY;
this.offset = this.cumulativeOffset(element);

return (this.ycomp >= this.offset[1] &&
this.ycomp < this.offset[1] + element.offsetHeight &&
this.xcomp >= this.offset[0] &&
this.xcomp < this.offset[0] + element.offsetWidth);
},

// within must be called directly before
overlap: function(mode, element) {
if (!mode) return 0;
if (mode == ‘vertical’)
return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
element.offsetHeight;
if (mode == ‘horizontal’)
return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
element.offsetWidth;
},

clone: function(source, target) {
source = $(source);
target = $(target);
target.style.position = ‘absolute’;
var offsets = this.cumulativeOffset(source);
target.style.top = offsets[1] + ‘px’;
target.style.left = offsets[0] + ‘px’;
target.style.width = source.offsetWidth + ‘px’;
target.style.height = source.offsetHeight + ‘px’;
},

page: function(forElement) {
var valueT = 0, valueL = 0;

var element = forElement;
do {
valueT += element.offsetTop || 0;
valueL += element.offsetLeft || 0;

// Safari fix
if (element.offsetParent==document.body)
if (Element.getStyle(element,’position’)==’absolute’) break;

} while (element = element.offsetParent);

element = forElement;
do {
valueT -= element.scrollTop || 0;
valueL -= element.scrollLeft || 0;
} while (element = element.parentNode);

return [valueL, valueT];
},

clone: function(source, target) {
var options = Object.extend({
setLeft: true,
setTop: true,
setWidth: true,
setHeight: true,
offsetTop: 0,
offsetLeft: 0
}, arguments[2] || {})

// find page position of source
source = $(source);
var p = Position.page(source);

// find coordinate system to use
target = $(target);
var delta = [0, 0];
var parent = null;
// delta [0,0] will do fine with position: fixed elements,
// position:absolute needs offsetParent deltas
if (Element.getStyle(target,’position’) == ‘absolute’) {
parent = Position.offsetParent(target);
delta = Position.page(parent);
}

// correct by body offsets (fixes Safari)
if (parent == document.body) {
delta[0] -= document.body.offsetLeft;
delta[1] -= document.body.offsetTop;
}

// set position
if(options.setLeft) target.style.left = (p[0] - delta[0] + options.offsetLeft) + ‘px’;
if(options.setTop) target.style.top = (p[1] - delta[1] + options.offsetTop) + ‘px’;
if(options.setWidth) target.style.width = source.offsetWidth + ‘px’;
if(options.setHeight) target.style.height = source.offsetHeight + ‘px’;
},

absolutize: function(element) {
element = $(element);
if (element.style.position == ‘absolute’) return;
Position.prepare();

var offsets = Position.positionedOffset(element);
var top = offsets[1];
var left = offsets[0];
var width = element.clientWidth;
var height = element.clientHeight;

element._originalLeft = left - parseFloat(element.style.left || 0);
element._originalTop = top - parseFloat(element.style.top || 0);
element._originalWidth = element.style.width;
element._originalHeight = element.style.height;

element.style.position = ‘absolute’;
element.style.top = top + ‘px’;;
element.style.left = left + ‘px’;;
element.style.width = width + ‘px’;;
element.style.height = height + ‘px’;;
},

relativize: function(element) {
element = $(element);
if (element.style.position == ‘relative’) return;
Position.prepare();

element.style.position = ‘relative’;
var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);

element.style.top = top + ‘px’;
element.style.left = left + ‘px’;
element.style.height = element._originalHeight;
element.style.width = element._originalWidth;
}
}

function getPos(el,sProp) {
var iPos = 0;
while (el!=null) {
iPos+=el["offset" + sProp];
el = el.offsetParent;
}
return iPos;
}
//清除文本框的提示
function clearDF(obj){
if(obj.getAttribute(’value’)==obj.getAttribute(’helptext’))obj.value=”;
}
//还原文本框的提示
function showDF(obj){
if(obj.value==”)obj.value=obj.getAttribute(’helptext’);
}

//对象拖动
//cid:被移动容器对象的id
//oid:被拖动对象的id
function drag(cid,oid){
o=document.getElementById(oid);
try {
o.firstChild.onmousedown=function(){return false;}; } catch (e) {}

o.onmousedown=function(a){

var d=document;if(!a)a=window.event;
c=d.getElementById(cid);
var x=a.layerX?a.layerX:a.offsetX,y=a.layerY?a.layerY:a.offsetY;
if(o.setCapture)
o.setCapture();
else if(window.captureEvents)
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
var theBody = document.getElementsByTagName(”BODY”)[0];
var scTop = parseInt(theBody.scrollTop,10);
var scLeft = parseInt(theBody.scrollLeft,10);
d.onmousemove=function(a){
if(!a)a=window.event;
if(!a.pageX)a.pageX=a.clientX;
if(!a.pageY)a.pageY=a.clientY;
var tx=a.pageX-x,ty=a.pageY-y;
c.style.left=scLeft+tx;
c.style.top=scTop+ty;
c.style.cursor=”move”
};
d.onmouseup=function(){
if(o.releaseCapture)
o.releaseCapture();
else if(window.captureEvents)
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
c.style.cursor=”default”;
d.onmousemove=null;
d.onmouseup=null;
};
};
}

popup.js(主要用来生成弹出层)

////////////////////////////////////////
var dataobj;
var curr_deep=1;
var popbindobj;

function getpoplibpos(){
var _width = $(”libpop”).offsetWidth;
var _height = $(”libpop”).offsetHeight;

var fullHeight = getViewportHeight();
var fullWidth = getViewportWidth();

//var theBody = document.documentElement;
var theBody = document.getElementsByTagName(”BODY”)[0];
//theBody.style.overflow = “hidden”;
var scTop = parseInt(theBody.scrollTop,10);
var scLeft = parseInt(theBody.scrollLeft,10);
var _top=getPos(popbindobj,”Top”)+popbindobj.offsetHeight;

//alert(”scTop=”+scTop+”&fullHeight=”+fullHeight+”&_top=”+_top+”_height=”+_height+”&”+(scTop+fullHeight-_top-_height));
if(scTop+fullHeight-_top-_height<0){
$(”libpop”).style.top = (scTop + (fullHeight - _height)) + “px”;
}else{
$(”libpop”).style.top =_top + “px”;;
}

var _left=getPos(popbindobj,”Left”);
//alert(”scLeft=”+scLeft+”&fullWidth=”+fullWidth+”&_left=”+_left+”_width=”+_width+”&”+(fullWidth-_left-_width<0));
if(fullWidth-_left-_width<0){
$(”libpop”).style.left = (scLeft + (fullWidth - _width)) + “px”;
}else{
$(”libpop”).style.left = _left + “px”;
}

}
/*
bindobj
_lib:要调用的lib名称
_width:弹出窗口的宽度
_cols:几列数据
_align:单列数据的对齐方式
_deep:几级选择
_parent:多级选择的父级id
*/
function showlib(bindobj,_lib,_width,_cols,_align,_deep,_parent){
curr_deep=1;

var libpop = $(”libpop”);
if(libpop==null){
libpop=document.createElement(’div’);
libpop.setAttribute(”id”,”libpop”);
libpop.setAttribute(”class”,”libpop”);
libpop.setAttribute(”className”,”libpop”);
libpop.style.display=”none”;
libpop.innerHTML=’<table border=0 class=”head” align=”center” width=”100%”><tr><td id=”headtext”> </td><td align=”right” nowrap id=”headopt”>[<a href="http://www.chaoketu.com/#" onClick="hiddenlibpop();return false;">关闭</a>]</td></tr></table><div class=”data” id=”datahtml”></div>’;
var body=document.getElementsByTagName(”BODY”)[0];
body.appendChild(libpop);
}

if(_width){libpop.style.width=_width+”px”;}
_cols=parseInt(_cols);
if(_cols<1 || isNaN(_cols)){_cols=1;}
if(!_align){_align=”center”;}
_deep=parseInt(_deep,10);
if(_deep<1 || isNaN(_deep)){_deep=1;}

popbindobj=bindobj;
dataobj=_lib;
var _title=popbindobj.getAttribute(”helptext”);

var _default=bindobj.getAttribute(”helptext”);
if(!_default){_default=”不限”;}
if(!_title){_title=popbindobj.getAttribute(”title”);}

if(bindobj.getAttribute(”value”) && bindobj.getAttribute(”value”)!=_title && bindobj.getAttribute(”value”).indexOf(”不限”)<0){

if(_title.indexOf(”城市”)>=0){
_title = “查找提示,其他城市请直接输入中文”;
}
$(”headtext”).innerHTML=_title+’: <b>’+bindobj.getAttribute(”value”)+’</b>’;
$(”headopt”).innerHTML=’[<a href="http://www.chaoketu.com/#" onclick="libclear(\''+_default+'\');return false;">清除</a>] [<a href="http://www.chaoketu.com/#" onClick="hiddenlibpop();return false;">关闭</a>]‘;
}else{

if(_title.indexOf(”城市”)>=0){
_title = “查找提示,其他城市请直接输入中文”;
}
$(”headtext”).innerHTML=_title+’: <b>’+bindobj.getAttribute(”value”)+’</b>’;;
$(”headopt”).innerHTML=’[<a href="http://www.chaoketu.com/#" onClick="hiddenlibpop();return false;">关闭</a>]‘;
}
libpop.style.display=”";

/*
if(Math.floor(i%_cols)){
for(var j=0;j<(_cols-Math.floor(i%_cols));j++){
datahtml+=’<td> </td>’;
}}
*/

$(”datahtml”).innerHTML=mkdata(_parent,_width,_cols,_align,_deep);
//alert(_width);
getpoplibpos();
}

function libclear(dfvalue){
setLibValue(”",dfvalue);
hiddenlibpop();
}
function mkdata(_parent,_width,_cols,_align,_deep){
var _lib=dataobj;
var datahtml=’<table border=”0″ width=”99%”><tr>’;
var j=0;
for(var i=0;i<_lib.length;i++){
if(_lib[i][2]==_parent ||(!_lib[i][2] && !_parent)){
_text=_lib[i][0];
//if(_text==”清空”){_text=”;}
_value=_lib[i][1];
if(j%_cols===0 && j!==0){datahtml+=’</tr><tr>’;}
if(hasson(_value,curr_deep,_deep)){
datahtml+=’<td align=”‘+_align+’” title=”‘+_text+’” width=”‘+(_width/_cols-1)+’”><a href=”http://www.chaoketu.com/#” onClick=”showsub(\”+_text+’\',\”+_value+’\',’+_width+’,'+_cols+’,\”+_align+’\',’+_deep+’);return false”>’+_text+’</a></td>’;
}else{
datahtml+=’<td align=”‘+_align+’” title=”‘+_text+’” width=”‘+(_width/_cols-1)+’”><a href=”http://www.chaoketu.com/#” onClick=”libClick(this,\”+_value+’\');return false”>’+_text+’</a></td>’;
}
j++;
}
}
datahtml+=’</tr></table>’;
return datahtml;
}

//是否有子项
function hasson(_value,curr_deep,all_deep){
if(all_deep<2){return false;}
if(curr_deep>=all_deep){return false;}

var len=dataobj.length;
var num=0;
for(var i=0;i<len;i++){
if(_value==dataobj[i][(curr_deep+1)]){num++;}
if(num>1){return true;}
}
return false;
}

function setLibValue(_value,_text){
popbindobj.value=_text;

//代码值填入代码隐藏域
//var bind=popbindobj.getAttribute(”codeinput”);
//if($(bind)){$(bind).value=_value;}

var frm=popbindobj.form.name;
if(popbindobj.name.indexOf(”_text”)!=-1){
var bind=popbindobj.name.replace(”_text”,”");
if(_value)
document.forms[frm][bind].value=_value;
}

//隐藏或显示手动输入的输入框
var def=popbindobj.getAttribute(”def”);
if(_value==”-2″){
var binddef=document.forms[frm][bind+"_def"];
if(binddef){
binddef.style.display=”";
binddef.value=binddef.getAttribute(”helptext”);
binddef.select();
}
}else{
var binddef=document.forms[frm][bind+"_def"];
if(binddef){
binddef.value=”";
binddef.style.display=”none”;
}
}

//popbindobj.value=obj.getAttribute(”value”);
}

function libClick(obj,_value){
setLibValue(_value,obj.firstChild.nodeValue);
hiddenlibpop();
}

function showsub(_parentText,_parentValue,_width,_cols,_align,_deep){
curr_deep++;
var datahtml=’<table border=”0″ width=”100%”><tr><td colspan=’+_cols+’><b>’+_parentText+’</b>(<a href=”http://www.chaoketu.com/#” onclick=”returnparent(\’\',’+_width+’,'+_cols+’,\”+_align+’\',’+_deep+’);return false”>返回上级</a>)</td></tr></table>’;
datahtml+=mkdata(_parentValue,_width,_cols,_align,_deep);
$(”datahtml”).innerHTML=datahtml;
}

function returnparent(_parent,_width,_cols,_align,_deep){
curr_deep–;
$(”datahtml”).innerHTML=mkdata(_parent,_width,_cols,_align,_deep);
}

function hiddenlibpop(el){
curr_deep=1;
var m=$(”libpop”);
if (el && m && m.style.display==”) {
if ((document.body.scrollLeft + window.event.x > el.offsetLeft)
&& (document.body.scrollLeft + window.event.x < el.offsetLeft + el.offsetWidth)
&& (document.body.scrollTop + window.event.y > el.offsetTop)
&& (document.body.scrollTop + window.event.y < el.offsetTop + el.offsetHeight)
|| (document.body.scrollLeft + window.event.x > m.offsetLeft)
&& (document.body.scrollLeft + window.event.x < m.offsetLeft + m.offsetWidth)
&& (document.body.scrollTop + window.event.y > m.offsetTop)
&& (document.body.scrollTop + window.event.y < m.offsetTop + m.offsetHeight)) {
} else {
m.style.display = ‘none’;
}
}else if(!el){
m.style.display = ‘none’;
}
}

search_pop_data.js(定义城市选项)

var _lib_city=[['北京','10090018001'],['天津','10090018002'],['上海','10090018009'],['河北','10090018003'],['山西','10090018004'],['内蒙古','10090018005'],['辽宁','10090018006'],['吉林','10090018007'],['黑龙江','10090018008'],['江苏','10090018010'],['浙江','10090018011'],['安徽','10090018012'],['福建','10090018013'],['江西','10090018014'],['山东','10090018015'],['河南','10090018016'],['湖北','10090018017'],['湖南','10090018018'],['广东','10090018019'],['广西','10090018020'],['海南','10090018021'],['重庆','10090018022'],['贵州','10090018024'],['陕西','10090018027'],['甘肃','10090018028'],['青海','10090018029'],['新疆','10090018031']];

可乐发表于:12-17-07

牧师天赋浅谈

垃圾文章凑合着看很一般还不错精品 (暂时没有评价)
Loading ... Loading ...

PVE部分:

http://www.wowhead.com/?talent=bxMhzbZZVGxpMxohtEo

常规输出天赋

76点命中在RAID中是必备的,如果你有额外的命中,你可以减少在暗影集中中投入的天赋,具体换算比率为
76 命中等级需要 5/5 暗影集中
101 命中等级需要 4/5 暗影集中
126 命中等级需要 3/5 暗影集中
152 命中等级需要 2/5 暗影集中
177 命中等级需要 1/5 暗影集中
202 命中等级需要 0/5 暗影集中
70级时 1% 命中 = 12.6 命中等级.

就我MS号现在来看,正好是126命中。我就我的输出习惯来看,调整了下适合自己的天赋。

http://www.wowchina.com/info/talents/priest.shtml?5002300130000000000000000000000000000000000053230510250103051551

MS刚刚接手,需要感受MS的输出节奏~跟LR是2种玩法。

PVP部分:

http://www.wowchina.com/info/talents/priest.shtml?5012123130520102000000223550110302100500300000000000000000000000

经典的28/33/0的PVP天赋。

2.3新兴 43/18 42/19深戒律天赋
http://www.wowchina.com/info/talents/priest.shtml?5052023130525102031021203551110000000000000000000000000000000000


Swarm 在用的 55天赋

http://www.wowhead.com/?talent=bxgMuhgtMcozfVtoc

其他小技巧:(转)

如何保持专注意志的效果呢?一个字,骗!
专注意志是一个最多存在8秒钟,但是可以叠加的效果,我们不能保证8秒内对方必暴,那么三次叠加的效果岂不是浪费了?不,我们能。
我们已知,人物在坐下的时候,受到的攻击是必爆的(而2.3以后坐下受到的暴击是可以骗出效果的),我们何不在战士空怒 盗贼空能量 或者被术士的狗追你的时候,坐下来给他一暴呢?具体坐法,我在盾、愈合、恢复,这三个瞬发技能上编上了坐下的宏,这样以来,我想坐就坐,而且2.3后,人物在坐的情况下使用技能会自动站起来,所以这对人物使用其他技能是不会有任何影响的。
例如
/cast 恢复(等级11)
/坐下

由此我们不难发现,专注意志更适合高韧性牧师使用,假定一个牧师极限韧性(496,减少25%的暴击伤害),对方平砍100 暴击200,牧师自身3叠专注意志,减少15%伤害,韧性减25%暴伤,实际对方只能打出145,而如果韧性太低,骗意志消耗自己的血量还没有减少的伤害少。

结论:在韧性没有400(其实我想把这个标准定到450以上以上)的情况下,使用43/18戒律天赋,不值得!所以43/18天赋并不适合目前绝大多数国服的牧师,特备是刚刚踏入竞技场道路的牧师。

关于预判大驱散.. 如果我们的集火目标转为对方法师或者834 这时我会把我的焦点目标转成这个目标 同时我的NECB会告诉我对方技能的CD 我的经验里 法师开冰箱的时候 一般是自己没技能用了.. 如果你的NECB显示法师的闪现和冰盾都在CD 而他身上带有断筋致死并且没有顶着战士读羊 那么 他一般会在2-3秒内开出冰箱(纯属个人经验) 这时我一般会把大驱的范围指向他 成功驱掉以后念心爆+灭 或许就能让对方率先减员… 834也一样 看他制裁和自由的CD 这里要说的是 无论834什么时候开无敌..能驱尽量要驱..12秒不受控的治疗会让你的队伍方寸大乱的..

暂时就这些吧~慢慢研究再。

18日新加:

http://www.wowchina.com/info/talents/priest.shtml?5002223130520102000000000000000000000000000050252010251103051000

个人认为比较合理的PVP天赋,兼顾输出与驱散

再研究发现
http://www.wowchina.com/info/talents/priest.shtml?5052323103020002000000000000000000000000000050252010251103051000

更为合适。在竟凑的战斗中根本不能指望精神回蓝这个东西。所以放弃。出了无声20%防止驱散。

可乐发表于:12-17-07

周末

垃圾文章凑合着看很一般还不错精品 (暂时没有评价)
Loading ... Loading ...

本来想昨天就放出来,但是昨天一直在网吧。不方便~(其实在玩一直)

周六北京流氓小分队又聚会了~总觉得和他们在一起才是最开心的时候。无比的放松,开着各种玩笑。不会担心玩笑开大了弄僵了关系。为啥?因为种种玩笑已经习惯了~

晚上去上岛腐败了一下。喝咖啡不是重点,重点是一群人坐在一起开怀大笑~希望时间不要把我们这份友谊淡化了。再数年之后,我们仍然可以坐在一起这样畅谈。

一句话一辈子,一生情一杯酒!

开始放图~照片是HHY的手机拍摄的~还是那句,手机照相很悲惨。

PS:头发咋就能乱成过这样呢……汗死

 

 

 

 

 

 

可乐发表于:12-17-07

iframe自适应高度

垃圾文章凑合着看很一般还不错精品 (暂时没有评价)
Loading ... Loading ...

方案一:

<iframe src=”http://www.chaoketu.com/shortpage.htm” name=”content” id=”content” allowtransparency=”true” align=”default” marginwidth=0 marginheight=0 frameborder=0 scrolling=no height=”200″ width=”500″ onload=”this.height=0;var fdh=(this.Document?this.Document.body.scrollHeight:this.contentDocument.body.offsetHeight);this.height=(fdh>200?fdh:200)//code by Tencent.nokersang”>This message is only visible to older browsers.</iframe>

方案二:

<script language=javascript>
function iframeAutoFit()
{
try
{
if(window!=parent)
{
var a = parent.document.getElementsByTagName(”IFRAME”);
for(var i=0; i<a.length; i++) //author:meizz
{
if(a[i].contentWindow==window)
{
var h = document.body.scrollHeight;
if(document.all) {h += 4;}
if(window.opera) {h += 1;}
a[i].style.height = h;
}
}
}
}
catch (ex)
{
alert(”脚本无法跨域操作!”);
}
}
if(document.attachEvent) window.attachEvent(”onload”, iframeAutoFit);
else window.addEventListener(’load’, iframeAutoFit, false);
</script>

可乐发表于:12-14-07

avast安装许可密匙

垃圾文章凑合着看很一般还不错精品 (暂时没有评价)
Loading ... Loading ...

在这里为大家提供avast专业版本通用序列号.基本全部能用,但是请大家支持正版,如果你喜欢专业版请及时购买专业版.
在这里我们avast俱乐部推荐大家使用avast家庭版,因为他对个人用户是免费的,而且杀毒效果和专业版是一样的.
http://my.avastbbs.cn/Html/wenzhang/zhucema/8_Index.html

号称是每天更新,可乐实验了好几个都无法升级~闹心
序列号:

S7110258R9956R0911-DUDTEZLX
S8063931R9973R0910-61DZRJYN
S7503139R9940R0911-R59S88M9
S2913629R9971R0910-4S7BHLE5
S3295402R9965R0910-EU8LT20D
S4490367R9967R0912-SM12ZWF8
S9798596R9944R0911-L5ZY5J7R
S7961937R9958R0912-0NTS4F1R
S2712282R9945R0911-VTL99S3U
S2860107R9954R0910-6WEPA16T
S2968328R9948R0911-49UX9WM2
S8589883R9958R0911-FKXRVWVY
S2789308R9950R0912-8TDSARUB
S3638517R9967R0910-MPZUS97U
S8802509R9942R0911-BUHCRN98
S2439907R9947R0910-4YCL28ZD
S6784419R9942R0912-SRXN46P6
S7544148R9945R0911-RHC2H0ZP
S7294329R9942R0912-CMNA081B
S7610125R9961R0912-VH0KJB1Z
S2954638R9976R0910-HTE2475D
S8260457R9978R0911-PVPT25H6
S8419560R9955R0912-DU66VYR4
S4991469R9945R0912-YJ0BZAYZ
S6033387R9974R0910-5NT9PP0Z
S8638413R9947R0910-BL4N04E7
S3322781R9958R0912-3AVF5827
S6309580R9967R0910-RX6RNNNZ
S5338460R9944R0910-Z591CPEY
S1654093R9962R0911-W4NNWA9C

可乐发表于:12-14-07

25条CSS制作网页编写的提醒及小技巧整理-可乐标注

垃圾文章凑合着看很一般还不错精品 (暂时没有评价)
Loading ... Loading ...

1、ul标签在Mozilla中默认是有padding值的,而在IE中只有margin有值。

2、同一个的class选择符可以在一个文档中重复出现,而id选择符却只能出现一次;对一个标签同时使用class和id进行CSS定义,如果定义有重复,id选择符做的定义有效,是因为ID的权值要比CLASS大。

ID是一个标签,用于区分不同的结构和内容,就象名字,如果一个屋子有2个人同名,就会出现混淆;
CLASS是一个样式,可以套在任何结构和内容上,就象一件衣服;

3、一个兼容性调整(IE和Mozilla)的笨办法:
初学可能会碰到这样一个情况:同样一个标签的属性在IE设置成A显示是正常的,而在Mozilla里必须要设成B才能正常显示,或者两个倒过来。
临时解决方法:选择符{属性名:B !important;属性名:A}

就现在的兼容来说,css hack是没办法的办法。我现在也在为这个头疼。

4、如果一组要嵌套的标签之间需要些间距的话,那就留给位于里面的标签的margin属性吧,而不要去定义位于外面的标签的padding

这个问题体现在宽度设置上,就比如你div的width属性设置了200,然后你又想让里面的文字距离边框10px,于是设置了padding,但是在FF里你就会发现,宽度变成了220.

5、li标签前面的图标推荐使用background-image,而不是list-style-image。

6、IE分不清继承关系和父子关系的差别,全部都是继承关系。

7、在给你的标签疯狂加选择符的时候,别忘了在CSS里给选择符加上注释。 等你以后修改你的CSS的时候就知道为什么要这么做了。

不要随便用一个怪异的名字来定义你的class。就从我接受的项目来说,莫名其妙的写法让我头疼得厉害。翻找下我前面写过的东西,可以看到一个CSS命名规则。详细请见u/kele/archives/2007/609.html

8、如果你给一个标签设置了一个深色调的背景图片和亮色调的文字效果。建议这个时候给你的标签再设置一个深色调的背景颜色。

9、定义链接的四种状态要注意先后顺序: Link Visited Hover Active

与此类似的还有margin和padding,用TRouBLe来记忆。就是Top Right Bottom Left。

10、与内容无关的图片请使用background

这个就是为了在无CSS调用的时候不影响整体页面风格。少用图片来表现风格。试想别人禁止图片后,你的网站还有什么可以看的东西。

11、定义颜色可以缩写#8899FF=#89F

简写标准~可惜我还没有这个好习惯~比如#FFFFFF我还是习惯这么写,而不是#FFF

12、table在某些方面比其它标签表现的要好的多。请在需要列对齐的地方用它。

div+css设计不是说你就完全放弃table,怎么表现的好才是重点

13、<script>没有language这个属性,应该写成这样:
<script type=”text/Javascript”>

但是在我接触到的很多网站页面里,是这么写的<script type=”text/Javascript” language=“javascript”>。莫名其妙~打开微软的网站你就可以看到<script type=”text/Javascript”>的表达方式

14、标题是标题,标题的文字是标题的文字。有时候标题不一定需要显示文字,所以:<h1>标题内容</h1> 改成 <h1><span>标题内容</span></h1>

我还是没有养成使用H1,H2标签的习惯~需要努力~

15、完美的单象素外框线表格(在IE5、IE6、IE7及FF1.0.4以上中均可通过测试)
table{border-collapse:collapse;}
td{border:#000 solid 1px;}

1象素黑色表格~

16、margin取负值可以在标签使用绝对定位的时候起到相对定位的作用,在页面居中显示时,使用绝对定位的层不适合使用left:XXpx这个属性。把这个层放到一个要相对定位的标签旁,然后使用margin的负值是个好方法。

负值时在布局中经常用到的方法~值得去学习下如何使用。

17、绝对定位时使用margin值定位可以达到相对于本身所在位置的定,这与top,left等属性相对与窗口边缘的定位不同。绝对定位的优势在于可以让其它元素忽略它的存在。

设计的时候你可以使用相对浮动层的绝对定位~有意想不到的效果。

18、如果文字过长,则将过长的部分变成省略号显示:IE5,FF无效,但可以隐藏,IE6有效
<DIV STYLE=”width:120px;height:50px;border:1px solid blue;overflow:hidden;text-overflow:ellipsis”>
<NOBR>就是比如有一行文字,很长,表格内一行显示不下.</NOBR>

恩,这个东西我在用~

19、在IE中可能由于注释带来的文字重复问题时可以把注释改为:
<!–[if !IE]>Put your commentary in here…<![endif]–>

20、如何用CSS调用外部字体
语法:
@font-face{font-family:name;src:url(url);sRules}取值:
name:字体名称。任何可能的 font-family 属性的值
url(url):使用绝对或相对 url 地址指定OpenType字体文件
sRules:样式表定义

为了防止用户没有字体而影响了网站效果~不过我觉得最好还是少用。

21、如何让一个表单中的文本框中的文字垂直居中?
如果用行高与高度的组在FF中是没有效果的,办法就是定义上下补白就可以实现想想的效果了。

22、定义A标签要注意的小问题:
当我们定义a{color:red;}时,它代表了A的四种状态的样式,如果此时要定义一个鼠标放上的状态只要定义a:hover就可以了,其它三种状态就是A中所定义的样式。
只定义了一个a:link时,一定要记得把其它三种状态定义出来!

hover属性是一个很强大的东西~有时间的人可以仔细研究下~

23、并不是所有样式都要简写:
当样式表前定义了如p{padding:1px 2px 3px 4px}时,在后续工程中又增加了一个样式上补白5px,下补白6px。我们并不一定要写成p.style1{padding:5px 6px 3px 4px}。可以写成p.style1{padding-top:5px;padding-right:6px;},你可能会感觉这样写还不如原来那样好,但你想没想过,你的那种写法重复定义了样式,另外你可以不必去找原来的下补白与左补白的值是多少!如果以后前一个样式P变了话,你定义的p.style1的样式也要变。

24、网站越大,CSS样式越多,开始做前,请做好充分的准备和策划,包括命名规则。页面区块划分,内部样式分类等。

非常非常非常非常重要~记得在压缩CSS的时候兼顾好你的可读性~非常非常非常非常重要~深受其害中。

25、几个常用到的CSS样式:
1)中文字两端对齐:text-align:justify;text-justify:inter-ideograph;

2)固定宽度汉字截断:overflow:hidden;text-overflow:ellipsis;white-space:nowrap;(不过只能处理文字在一行上的截断,不能处理多行。)(IE5以上)FF不能,它只隐藏。

3)固定宽度汉字(词)折行:table-layout:fixed; word-break:break-all;(IE5以上)FF不能。

4)<acronym title=”输入要提示的文字” style=”cursor:help;”>文字</acronym>用鼠标放在前面的文字上看效果。这个效果在国外的很多网站都可以看到,而国内的少又少。

5)图片设为半透明:.halfalpha { background-color:#000000;filter:Alpha(Opacity=50)}在IE6及IE5测试通过,FF未通过,这是因为这个样式是IE私有的东西;

6)Flash透明:选中swf,打开原代码窗口,在</object>前输入<param name=”wmode” value=”transparent”> 以上是针对IE的代码。
针对FIREFOX 给<embed> 标签也增加类似参数wmode=”transparent”

7)在做网页时常用到把鼠标放在图片上会出现图片变亮的效果,可以用图片替换的技巧,也可以用如下的滤镜:
.pictures img {
filter: alpha(opacity=45); }
.pictures a:hover img {
filter: alpha(opacity=90); }

恩,暂时就这些吧~以后遇到问题就会放上来,方便大家共同进步~嘿嘿

可乐发表于:12-14-07

如何快速记忆CSS所有属性

垃圾文章凑合着看很一般还不错精品 (暂时没有评价)
Loading ... Loading ...


字体属性:(font)
大小 font-size: x-large;(特大) xx-small;(极小) 一般中文用不到,只要用数值就可以,单位:PX、PD
样式 font-style: oblique;(偏斜体) italic;(斜体) normal;(正常)
行高 line-height: normal;(正常) 单位:PX、PD、EM
粗细 font-weight: bold;(粗体) lighter;(细体) normal;(正常)
变体 font-variant: small-caps;(小型大写字母) normal;(正常)
大小写 text-transform: capitalize;(首字母大写) uppercase;(大写) lowercase;(小写) none;(无)
修饰 text-decoration: underline;(下划线) overline;(上划线) line-through;(删除线) blink;(闪烁)
常用字体:(font-family)
“Courier New”, Courier, monospace, “Times New Roman”, Times, serif, Arial, Helvetica, sans-serif, Verdana

背景属性:(background)
色彩 background-color: #FFFFFF;
图片 background-image: url();
重复 background-repeat: no-repeat;
滚动 background-attachment: fixed;(固定) scroll;(滚动)
位置 background-position: left(水平) top(垂直);
简写方法 background:#000 url(..) repeat fixed left top;

区块属性:(Block)
字间距 letter-spacing: normal; 数值
对齐 text-align: justify;(两端对齐) left;(左对齐) right;(右对齐) center;(居中)
缩进 text-indent: 数值px;
垂直对齐 vertical-align: baseline;(基线) sub;(下标) super;(下标) top; text-top; middle; bottom; text-bottom;
词间距 word-spacing: normal; 数值
空格 white-space: pre;(保留) nowrap;(不换行)
显示 display:block;(块) inline;(内嵌) list-item;(列表项) run-in;(追加部分) compact;(紧凑) marker;(标记) table; inline-table; table-raw-group; table-header-group; table-footer-group; table-raw; table-column-group; table-column; table-cell; table-caption;(表格标题)

方框属性:(Box)
width:; height:; float:; clear:both; margin:; padding:; 顺序:上右下左

边框属性:(Border)
border-style: dotted;(点线) dashed;(虚线) solid; double;(双线) groove;(槽线) ridge;(脊状) inset;(凹陷) outset;
border-width:; 边框宽度
border-color:#;
简写方法 border:width style color;

列表属性:(List-style)
类型 list-style-type:disc;(圆点) circle;(圆圈) square;(方块) decimal;(数字) lower-roman;(小罗码数字) upper-roman; lower-alpha; upper-alpha;
位置 list-style-position: outside;(外) inside;
图像 list-style-image: url(..);

定位属性:(Position)
Position: absolute; relative; static;
visibility: inherit; visible; hidden;
overflow: visible; hidden; scroll; auto;
clip: rect(12px,auto,12px,auto) (裁切)

可乐发表于:12-14-07

新栏目

垃圾文章凑合着看很一般还不错精品 (暂时没有评价)
Loading ... Loading ...

又新添加了一个新的栏目,有时候有些设计真的让人们为之叫好~

这个栏目就用来放我觉得相当不错的设计,创意~

 

生活不是乏味的,乏味的是你自己~

 

助力车~恩恩,喜欢

 

看起来回很舒服,不过怎么把它从窄小的楼道里搬到家里是个问题

 

 

花可以这样养~

 

第一次来的人会不会便不出来

 

我喜欢的包风格

 

 

似乎也只能放这种鞋

 

高矮结合

 

 

 

这个座也是我喜欢的。上次还见过一个吊床~我问HHY感觉如何,她说ML的时候会不方便~MAY BE

可乐发表于:12-14-07

关于浏览器的问题

垃圾文章凑合着看很一般还不错精品 (暂时没有评价)
Loading ... Loading ...

网页标准计划小组(WSP)有一个综合测试的网页,叫Acid,现在第二版为Acid2,测试地址如下:
http://www.webstandards.org/files/acid2/test.html

如果能够完整的显示下面这个图形,他们就认为是符合标准的

我测试了一下,IE6,IE7,FF,Opear9.24
只有Opear能够正常显示~

但是做东西还是要用FF和IE6/7测试,尤其是IE。没办法,人多啊~
现在搞得标准的成不标准,不标准的成了标准~
这个世界太疯狂~

可乐发表于:12-13-07