Guest User

Untitled

a guest
May 21st, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. var Glow = Class.create({
  2. initialize: function(b_ele) {
  3. this.b_ele = $(b_ele);
  4. this.g_ele = this.b_ele.next(0);
  5. this.c_bit = 0;
  6. this.a_E(this);
  7. },
  8. t_Ch:function(){
  9. if(this.c_bit == 1){
  10. this.d_T()
  11. }else{
  12. this.d_F()
  13. }
  14. },
  15. t_E:function(){
  16. var data = $A(arguments);
  17. _eObj = data[0];
  18. _gObj = data[1];
  19. if(_eObj.type.indexOf('mouseover') != -1){
  20. this.c_bit = 1;
  21. this.t_Ch(this);
  22. }
  23. if(_eObj.type.indexOf('mouseout') != -1){
  24. this.c_bit = 0;
  25. this.t_Ch(this);
  26. }
  27. },
  28. d_T:function(){
  29. new Effect.toggle(this.g_ele,'appear',{
  30. duration:0.5,
  31. queue:{position: 'end', scope: 'glow'+this.g_ele.id+'', limit: 1},
  32. transition:Effect.Transitions.sinoidal,
  33. afterFinish:(function(effect){this.t_Ch()}).bind(this)
  34. })
  35. },
  36. d_F:function(){
  37. new Effect.Fade(this.g_ele,{
  38. duration:0.5,
  39. transition:Effect.Transitions.sinoidal,
  40. queue:{position: 'end', scope: 'glow'+this.g_ele.id, limit: 1},
  41. beforeStart:function(effect){
  42. if(!effect.element.visible())
  43. effect.cancel();
  44. }
  45. })
  46. },
  47. a_E:function(obj){
  48. obj.b_ele.observe('mouseover',obj.t_E.bindAsEventListener(this,obj)).observe('mouseout',obj.t_E.bindAsEventListener(this,obj))
  49. }
  50. })
  51. document.observe('dom:loaded',function(){
  52. $$('div.button').each(function(ele,index){
  53. ele[index] = new Glow(ele.id)
  54. })
  55. })
Add Comment
Please, Sign In to add comment