Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Zepto with jQuery Mobile

Until now I have always used the standard jQuery library in combination with jQuery mobile for mobile web development. I recently stumbled on the Zepto library, which promises almost equivalent functionality with considerable less code. I attempted to simply replace the jQuery library in one of my pages with the Zepto.js library, but this doesn't seem to work. Is there any way to combine these two libraries without having to perform a major rewrite of existing code?

like image 815
danvdende Avatar asked Jun 01 '26 08:06

danvdende


1 Answers

Some of the comments are trying to point out that if you want to use Zepto instead of jQuery because you'd concerned about application size then perhaps you should also consider an alternative to jQuery mobile which will just like jQuery be a larger library. Granted it comes with more options and layouts but at a size cost.

If you want to make size savings you should aim at doing it with all your libraries especially the biggest ones (where you can save the most). jQuery mobile is about 140kb minified.

There are some alternatives to jQuery mobile build with size in mind:

  • zepto-page-transitions 7kb, implements transitions only (I think it doesn't have layouts or interface elements)
  • jQTouch 9kb, Seems to implement lots of ui options like jQuery mobile.

Note: I didn't include css or image sizes.

like image 155
paaat Avatar answered Jun 04 '26 01:06

paaat