📜 ⬆️ ⬇️

Classy Query - jQuery humanly.

John Resig (John Resig), the author of the notorious JS-library jQuery, finally decided to make a true competition Prototype. He added jQuery using the OOP approach. Now your terrible “hacker” code on jQuery will look quite readable and decent (according to other programmers), like this:

  <script src = "jquery.js"> </ script> 
 <script src = "classy.js"> </ script> 
 <script>
 jQuery.Events.addEventListener (document, "ready", function () {
   jQuery.querySelectorAll ("div"). forEach (function (elem) {
     jQuery.DOM.append (elem, "<b> More ... </ b>");
   });

   jQuery.querySelectorAll ("div b"). forEach (function (elem) {
     jQuery.Events.addEventListener ("click", function (elem, event) {
       var next = jQuery.Traversal.nextSibling (elem);
       var animation = jQuery.Effects.buildAnimation (next, {height: "toggle"});
       amimation.start ();
     });
   });
 });
 </ script>


Liked? Here is the source classy.js

')

Source: https://habr.com/ru/post/22710/


All Articles