我需要运行一些代码, 显示页面加载后被输入 DOM 元素的焦点和模糊事件。 所以我使用 Zepto s on
("http://zeptojs.com/ #on" rel= "nofollow" eptos on link a>) 来运行代码, 但对我没用 。
这是我试图让它发挥作用的智囊团——http://jsfiddle.net/ashfame/zR2xL/
我需要运行一些代码, 显示页面加载后被输入 DOM 元素的焦点和模糊事件。 所以我使用 Zepto s on
("http://zeptojs.com/ #on" rel= "nofollow" eptos on link a>) 来运行代码, 但对我没用 。
这是我试图让它发挥作用的智囊团——http://jsfiddle.net/ashfame/zR2xL/
在初始 JSFiddle 中, 您在声明上稍有偏差。 当您使用 . live()
“ version” 的 .on()
, 您会用 Zepto (因为, 我相信, < code>. live() 函数在幕后的作用) 选择文档, 然后应用 .on()
方法, 并通过参数 event
, < elector
和 函数
。 它看起来类似 :
$(document).on(event, selector, function);
看看这个 < a href=>" "http://jsfiddle.net/zR2xL/7," rel="nofollow" >JSFiddle 我对您在评论中张贴的那张稍作修改。
我所做的修改是:
console.log()
to stop errors from being throwndocument.write
to a $( body ).append()
希望有帮助!
你小提琴的问题在于 不知何故小提琴弄乱了整个文件的写作
虽然你很亲近,但您无法将事件收听器附加到您用 $( node).on ()
尝试过的不存在的节点上。
然而,从链接的文档中,你应该像这样使用它:
$(document).on("click", "selector", fn);
我更新了你的小提琴 使用Zepto而不是jQuery, 并设置它运行在 DomReady 上, 这使得您代码中的准备事件没有必要 。
I have this simple script: function orientation() { var orientation = window.orientation; switch(orientation) { case 0: alert( 0 ); break; case 90: alert( 90 ); ...
Hey why in the name of god does this return "undefined" on an <a> tag with an href? function ajax(){ $( a ).bind( click , function(e){ e.preventDefault(); var linkhref = $(...
I am using Zepto.js, ICanHaz.js, and Backbone.js. I have a couple of templates that I am trying to render. After rendering the template and inserting the result into the page, the only output that I ...
Does anyone know how to change the type of animation the page/sections uses? I read the docs but couldn t understand a single thing. I like the framework and I really want to give it a try but there ...
I m trying to bind an event handler to a click function using zepto.js. Normally in JQuery I can just say return false and the actual click will never go through. Does Zepto not support this? And ...
i m trying to rewrite a little but awesome jquery plugin for zepto.js: https://github.com/phiggins42/bloody-jquery-plugins/blob/master/pubsub.js i don t think its a ploblem, because the syntax is ...
jQuery can do some nice things for you. It also frees you from having to take care for different browsers. The tradeoffs are the size and readability jQuery s own code. Is there a similar library ...
I m wondering if someone has tried already to port jQueryMobile on top of Zepto.js (http://zeptojs.com/) instead of the required jQuery?