jquery 第一个节点_关于我的第一个jQuery体验的想法

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体验会带来什么。 让我分享一些有关经验的想法。

  1. Porting over the original Moo class didn't take very long. I think I caught on to things pretty quickly.

    移植到原始的Moo类并不需要很长时间。 我想我很快就掌握了一切。
  2. 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函数如何捕获它们的集合。

  3. 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
    		})
    	
    
    	
  4. MooTools' syntax is prettier, in my opinion. jQuery, to its credit, doesn't require as much code.

    我认为MooTools的语法更漂亮。 值得称赞的是,jQuery不需要那么多代码。
  5. Not once did I consider speed because I know both of these libraries are lightning fast.

    我没有一次考虑速度,因为我知道这两个库都快如闪电。
  6. The jQuery documentation is great. It was very helpful during this first exercise.

    jQuery文档很棒。 在第一次练习中,这非常有帮助。
  7. 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的类创建结构-只是有所不同。
  8. jQuery and MooTools aren't that different.

    jQuery和MooTools没什么不同。
  9. Chris Coyier's MaxSide: jQuery Plugin (and How-To) article was extremely helpful, as was his help via IM.

    克里斯· 科耶尔( Chris Coyier)的《 MaxSide:jQuery插件(和操作方法)》一文非常有帮助,他通过IM提供的帮助也非常有用。

  10. 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)也做了他的尽职调查。
  11. 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 第一个节点

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值