[Code] Tắt đèn forum

  Bài viết hay nhất1
Tương tự như bài này nhưng đơn giản hơn: https://camxuc9x.forumvi.com/t1260-topic#4719
Chèn code sau vào: overall_footer_end là xong
Code:
<!--tắt điện-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
(function(){
  var im2 = new Image();
  im2.src = 'http://i28.servimg.com/u/f28/13/58/60/43/i_fold12.png';
  jQuery(function($){
      var w = $(window), dimmer = $('<div style="position:fixed;z-index:-1;top:0;left:0;display:none;background-color:#000;"><\/div'),
      im1 = $('#onoff').toggle(lightsOut, lightsOn).css({zIndex: 11, position: 'relative', cursor: 'pointer'}).attr('src');
      function dresize(){dimmer.css({height: w.height(), width: w.width()});}
      function lightsOut(){this.title = this.alt = 'Lights On'; this.src = im2.src; dimmer.stop().css({zIndex: 10}).animate({opacity: 0.85, duration: 'slow'});}
      function lightsOn(){this.title = this.alt = 'Lights Off'; this.src = im1; dimmer.stop().css({zIndex: -1}).animate({opacity: 0, duration: 'slow'});}
      dresize();
      $('body').append(dimmer.css({opacity: 0, display: 'block'}));
      w.resize(dresize);
  });
})();
</script>
</head>
<body>
<img id="onoff" src="http://i28.servimg.com/u/f28/13/58/60/43/i_fold15.png" width="alt="Lights Off" title="Lights Off"><br>
<!--End tắt điện-->
Bạn không có quyền trả lời bài viết