Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Glow = Class.create({
- initialize: function(b_ele) {
- this.b_ele = $(b_ele);
- this.g_ele = this.b_ele.next(0);
- this.c_bit = 0;
- this.a_E(this);
- },
- t_Ch:function(){
- if(this.c_bit == 1){
- this.d_T()
- }else{
- this.d_F()
- }
- },
- t_E:function(){
- var data = $A(arguments);
- _eObj = data[0];
- _gObj = data[1];
- if(_eObj.type.indexOf('mouseover') != -1){
- this.c_bit = 1;
- this.t_Ch(this);
- }
- if(_eObj.type.indexOf('mouseout') != -1){
- this.c_bit = 0;
- this.t_Ch(this);
- }
- },
- d_T:function(){
- new Effect.toggle(this.g_ele,'appear',{
- duration:0.5,
- queue:{position: 'end', scope: 'glow'+this.g_ele.id+'', limit: 1},
- transition:Effect.Transitions.sinoidal,
- afterFinish:(function(effect){this.t_Ch()}).bind(this)
- })
- },
- d_F:function(){
- new Effect.Fade(this.g_ele,{
- duration:0.5,
- transition:Effect.Transitions.sinoidal,
- queue:{position: 'end', scope: 'glow'+this.g_ele.id, limit: 1},
- beforeStart:function(effect){
- if(!effect.element.visible())
- effect.cancel();
- }
- })
- },
- a_E:function(obj){
- obj.b_ele.observe('mouseover',obj.t_E.bindAsEventListener(this,obj)).observe('mouseout',obj.t_E.bindAsEventListener(this,obj))
- }
- })
- document.observe('dom:loaded',function(){
- $$('div.button').each(function(ele,index){
- ele[index] = new Glow(ele.id)
- })
- })
Add Comment
Please, Sign In to add comment