minimal jquery alternative for fast mobile webapps

微笑、不失礼 提交于 2019-12-06 13:17:08

问题


I need a dead simple jq alternative, as tiny as possible and more or less with only requirements:

  • slideUp/down.
  • json get
  • basic DOM

The iPhone-look alike-frameworks doesn't do it for me (overdone and heavy for the purpose) which, to my knowledge, leaves me with xui.js, http://xuijs.com/.

Unfortunately, the slideUp / accordeon - functions seems buggy or at least not working as expected.

Thankful for any input if there's other minimal libraries around. Or if anyone has got the slideup to work with xui in an accordeon-fashion.

(Things has changed since previous post request: minimal framework for web-apps, valuable information from Gaby aka G. Petrioli over there)

To clarify my issues with xui, upon using:

x$('#box').tween({ height:'0px', color:'#00ff00', backgroundColor:'blue' }, function()
{
  alert('done!');
});

The content of the #box (div) is still visible, even though the div with it's bg-color slides up nicely. Am I using it correctly?

Regards,

//t


回答1:


The absolute lightest way to do a lot of things is stick to something along the lines of vanilla JavaScript. I created a set of basic functions as part of a side project I've been working on recently that may be of use to you. Essentially its just a vanilla JavaScript Object that provides 4 simple animation types (fadein/fadeout + slidedown/slideup) along with some basic helper functions (addClass, removeClass) etc. Just rip the base function out of my gitHub code https://github.com/thybag/JSnip/blob/master/jsnip.js and customise it to your own needs. (Sorry about plugging my link, but I though pasting the code would be overkill) [Note: this also lacks a JSON get method as of now, though I assume finding a vanilla JavaScript function to do this shouldn't be to hard if you do decided to go the plain JavaScript route.]

If you'd rather something a little better supported you could just try JQuery Mobile version: http://jquerymobile.com/ I've also heard http://www.sencha.com/products/touch/ is pretty good for mobile development (though I think its still reasonably heavy weight)

Sorry I can't be of more help.




回答2:


Try Zepto, MinifiedJS or Midori if you don't like Xui.



来源:https://stackoverflow.com/questions/6559579/minimal-jquery-alternative-for-fast-mobile-webapps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!