jquery 第一个节点
Yesterday I debuted my first jQuery script/plugin: dwImageProtector. As a MooTools fanatic, I wasn't sure what to expect from this first jQuery experience. Let me share a few thoughts on the experience.
昨天我首次发布了第一个jQuery脚本/插件dwImageProtector 。 作为MooTools的狂热者,我不确定第一次jQuery体验会带来什么。 让我分享一些有关经验的想法。
Porting over the original Moo class didn't take very long. I think I caught on to things pretty quickly. 移植到原始的Moo类并不需要很长时间。 我想我很快就掌握了一切。I'm not huge on $() returning more than just one element. I like how Moo's dollar function grabs ONE and ONLY ONE element and the double-dollar function grabs a collection of them.
我对$()返回的不只是一个元素不是很大。 我喜欢Moo的dollar函数如何捕获一个并且只有一个元素,而double $ dollar函数如何捕获它们的集合。
MooTools:
MooTools:
var p = new Element('img', { src: this.options.image, width: size.width, height: size.height, styles: { 'z-index': this.options.zIndex, 'left': size.left + 'px', 'top': size.top + 'px', 'position': 'absolute' } })jQuery:
jQuery的:
$('<img />').attr({ width: width, height: height, src: settings.image }).css({ border: '1px solid #f00', top: position.top, left: position.left, position: 'absolute', zIndex: settings.zIndex }) MooTools' syntax is prettier, in my opinion. jQuery, to its credit, doesn't require as much code. 我认为MooTools的语法更漂亮。 值得称赞的是,jQuery不需要那么多代码。 Not once did I consider speed because I know both of these libraries are lightning fast. 我没有一次考虑速度,因为我知道这两个库都快如闪电。 The jQuery documentation is great. It was very helpful during this first exercise. jQuery文档很棒。 在第一次练习中,这非常有帮助。 I like jQuery's structure of creating and using a plugin. I can see its appeal. Not more than MooTools' class creation structure -- it's just different. 我喜欢jQuery创建和使用插件的结构。 我可以看到它的吸引力。 不仅仅是MooTools的类创建结构-只是有所不同。 jQuery and MooTools aren't that different. jQuery和MooTools没什么不同。Chris Coyier's MaxSide: jQuery Plugin (and How-To) article was extremely helpful, as was his help via IM.
克里斯· 科耶尔( Chris Coyier)的《 MaxSide:jQuery插件(和操作方法)》一文非常有帮助,他通过IM提供的帮助也非常有用。
jQuery's Evangelist, Rey Bango, did his job well to get me to try his library. Jeremy Martin did his due diligence too. jQuery的传播者Rey Bango出色地完成了工作,让我尝试了他的库。 杰里米·马丁(Jeremy Martin)也做了他的尽职调查。 I encourage all jQuery users to give MooTools a shot and to not be afraid of using Moo. It has a reputation for having a large learning curve, which is definitely not the truth. 我鼓励所有jQuery用户尝试一下MooTools,不要害怕使用Moo。 它以学习曲线宽广而闻名,这绝对不是事实。I was really happy to add some jQuery to my repertoire. From this point forward, I'm going to try to provide everything that I do in MooTools in jQuery format also. Let me know if there's a Moo class that I've created that you'd like ported to jQuery.
我非常高兴为我的曲目添加一些jQuery。 从现在开始,我将尝试以jQuery格式提供在MooTools中所做的一切。 让我知道是否存在您要移植到jQuery的Moo类。
翻译自: https://davidwalsh.name/first-jquery-experience
jquery 第一个节点
相关资源:jdk-8u281-windows-x64.exe