malko / basic-compat Goto Github PK
View Code? Open in Web Editor NEWlightweight jquery/zepto compatibility layer with mobile target in mind
lightweight jquery/zepto compatibility layer with mobile target in mind
First off, I just want to thank you for saving me hours and hours of work. I recently got fed up with jQuery because of its size and decided to build my own, but lo and behold! Here you are! So thank you.
Now, to business.
The reason why I dislike jQuery is because it has thousands of methods that I never use.
My plan was to make an entirely plugin-based version of jQuery. Making it very customizable.
Even your class has methods I never use, like "off", "removeAttribute", and others. Also, there are functions that I miss, like "after", "parent" and others.
At first I thought I would take your class and dismantle it and put it back together, but then I thought I'd check in with you and see what you think. I would prefer not to have to dismantle your next version as well.
The idea is as follows. Every method (not the core ones, like "each", "on", and a few others) should be stand-alone, in a separate file. Like so:
/**
** @requires $.foo
** @requires $.bar
**/
$.after=function(element,new_element){
// bla bla bla
};
$.fn.after=function(element){
return $.each(this,function(){
$.after(this,element);
});
};
Then you can either include them programmatically, the way I do, or you merge them into one file, whichever suits your fancy.
What do you think?
Yours,
Jonas
If I do $(element).trigger("select"), the select-event is triggered, but the text isn't selected. Same thing with "blur" and "focus", probably others as well.
/ jonas :)
Hello again!
I've run into some ie8 issues.
first:
the slice function does not work on nodelists
return [].slice.call(v,0);
and $(this) in
$("#nav").on("mouseover",function(){
console.debug(
$(this).hide();
});
does not work.
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.