如何从jQuery库中提取单个函数? [英] how to extract single function from jquery library?

查看:79
本文介绍了如何从jQuery库中提取单个函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想使用jquery库中的三种方法而不将整个库导入我的文件中,那么有什么方法可以从jquery中仅提取fadeIn(),fadeOut(),load()吗?

I want to use only three methods from the jquery library without importing the whole library in my file, so is there any way to extract only fadeIn(), fadeOut(), load() from jquery?

推荐答案

您可以查看源代码,并尝试删除fadeIn和fadeOut方法不需要的所有内容,但最终可能会占用大多数库.

You could look at the source code and try to remove anything not required for the fadeIn and fadeOut methods, but you would likely end up with most of the library.

总的来说,jQuery并不是一个简单的设计,而是一个单一的小型资源库.如果它不够小,可以检查 http://zeptojs.com .

Overall jQuery is not designed to be taken ala cart, it is designed to be a single small footprint library. If it is not small enough for you needs, you might check out http://zeptojs.com.

这篇关于如何从jQuery库中提取单个函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆