English 中文(简体)
j 优质综合症 检查
原标题:jQuery Syntax Check

如果我把这种假装改成 j,这是否正确?

<>Prototype:

this.selected.observe( click , this.toggle.bindAsEventListener(this))

http://www.ohchr.org。

$j(this).bind( click ).toggle(this);

我怎么说?

问题回答
$(this).bind( click , function(){ $(this).toggle(); });

我唯一的混淆是,这在一开始? 通常,你会按照美元(可兑换)的思路做一些事情。

也可以使用:

$( .toggleable ).live( click , ...

相反。 这使在(文件)校外可使用的额外红利,因为如果将新的可控物体加上其点击事件,而不是约束所有现有可裂变材料,如果无证件的话。 不可能。

$j(this).click(function(){
    $j(this).toggle();
});

注:.click(handler) is a shortcut for .bind( Point ,handler)

I think you re looking for:

$(this).bind( click ,function () {
    $(this)
}

牢记这一点指的是你在职能范围内使用该功能时的其他情况。 现在是你要求它做的事。 页: 1

$( #object ).bind( click , function() {
    $(this) // this  refers to the  object 
}




相关问题
Javascript drop down menu widget

I have a menu consisting of an <ul> in a Web CMS. I want several menu items to have sub-items that are displayed in a dropdown list. These sub-items are <ul>s as well. This is basically ...

highlight div or p after loading

Hello i need to highlight a div after my page is loading, i don t know if i should use a partial or something like that, the partial also has to have 2 variables disponible. Code to highlight after ...

Turning a DIV into a click-and-drag viewport

Does somebody know an unobtrusive, Prototype or no framework based way to turn a DIV with big content (e.g. a map) into a clickable and draggable "map" container with fixed dimensions, very much like ...

bug when prototype and jQuery are both loaded

I have function in Javascript which works fine using prototype. The function is used to dynamicaly change a select field based on the selection of another field. var sizes_286 = new Array(); ...

beginner javascript question

This should be easy, but since I m new to programming, specially in javascript, I cannot figure it out. Let s say I have the following javascript code: var InjectClientValue = Class.create(); ...

How to use Scriptaculous effects on error messages

I want to use some Scriptaculous effects on error messages. <% form_for(@page) do |f| %> <%= f.label :name %> <%= f.text_field :name %> <%= f.error_message_on "name" ...

Scrolling to the bottom of a div

As part of an ajax chat room (using prototype framework) I am working on I scroll the user to the bottom each time a message is added using the below js. However if the user has scrolled up and the ...

Compare text with innerHTML IE7 problem

I can t find a work around for the innerHTML bug in IE7. I need to look at the contents of dynamicly generated HTML and change it if the text is "-1". I m using the prototype js gallery but couldn t ...

热门标签