Visa ett inlägg
Oläst 2007-03-30, 11:31 #4
Kaffe Kaffe är inte uppkopplad
Medlem
 
Reg.datum: Dec 2003
Inlägg: 227
Kaffe Kaffe är inte uppkopplad
Medlem
 
Reg.datum: Dec 2003
Inlägg: 227
Kod:
var niceSearch = {
	s : Object,
	init : function() {
 altValue = 'Vill du inte S\u00F6ka?';
  	for (var i = 0; i < arguments.length; i++) {
 	this.s[i]=$(arguments[i]);
 	addEvent(this.s[i],'focus',this.focus,false);
 	addEvent(this.s[i],'blur',this.blur,false);
 }
	},
	focus : function() {
 if ( this.value == this.defaultValue || this.value == altValue) {
 this.value = '';
 this.className = 'focus';
 }
	},
	blur : function() {
 if ( this.value == '' ) {
 	this.value = altValue;
 	this.className = 'blur';
 }
	}
};
Jag använder något sänt här, men så är jag ju lite omständig av mig också .

Bör notera att ovanstående kräver någon form av EventHandler.
Kaffe är inte uppkopplad   Svara med citatSvara med citat