this.$el .prototype .proxy

this.$el = $( ‘<div class=”gr-room”><div class=”gr-wall-main”><div class=”gr-floor”></div></div></div>‘ ).insertAfter( $itemsContainer );

  •  4 walls (or 1 if no support for 3dtransforms)
  • adjust the value of the perspective according to the value of the current window’s width

$(this.el) wraps an element with jQuery. So, if your view HTML was this:

<div id="myViewElement"></div>

…and this.el referenced that div, then $(this.el) would be the equivalent of retrieving it directly via jQuery: $('#myViewElement').

In JavaScript, the prototype is the mechanism which provides inheritance (as opposed to, say, classes). Example:String.prototype refers to the prototype object of Strings, which contains (among other things) methods which can be invoked on any String.

$('ul li').each(function()

This is far more simple to walk over a set of elements with the .each() function.

jQuery.proxy( function, context [, additionalArguments ] )

This method is most useful for attaching event handlers to an element where the context is pointing back to a different object. Additionally, jQuery makes sure that even if you bind the function returned from jQuery.proxy() it will still unbind the correct function if passed the original.

It allows us the ability to force a particular context when calling a method. In JavaScript, there can be times when it’s difficult to hold on to the this keyword. For example, when it’s bound to some event handler, this now refers to the target of the handler, rather than your desired object.

jquery append script to html element dynamically

The .append() method inserts the specified content as the last child of each element in the jQuery collection (To insert it as the first child, use .prepend()).

<div class="container">
<div class="inner">Hello</div>
<div class="inner">Goodbye</div>
$(‘.inner’).append(‘<p>Test</p>’); // append()前面是要选择的对象后面是要在对象内插入的元素内容
<div class="container">
<div class="inner">
<div class="inner">

The .append() and .appendTo() methods perform the same task. The major difference is in the syntax-specifically, in the placement of the content and target:

  • With .append(), the selector expression preceding the method is the container into which the content is inserted.
  • With .appendTo(), on the other hand, the content precedes the method, either as a selector expression or as markup created on the fly, and it is inserted into the target container.

$(‘<p>Test</p>’).appendTo(‘.inner’); //appendTo()前面是要插入的元素内容,而后面是要选择的对象

this.$navPrev = $( ‘<span class=”gr-prev”>prev</span>’ ).on( ‘click’, $.proxy( this.navigate, this, ‘prev’ ) );
this.$navNext = $( ‘<span class=”gr-next”>next</span>’ ).on( ‘click’, $.proxy( this.navigate, this, ‘next’ ) );
this.$nav = $( ‘<nav/>’ ).append( this.$navPrev, this.$navNext ).appendTo( $gallery );

// add caption container
this.$caption = $( ‘<div class=”gr-caption”><span class=”gr-caption-close”>x</span></div>’ ).appendTo( $gallery );
this.$caption.find( ‘’ ).on( ‘click’, $.proxy( this.hideDescription, this ) );


<span class=”gr-prev”>prev</span><span class=”gr-next”>next</span>


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s




Just another site

Jing's Blog

Just another site

Start from here......







Just another site

Where On Earth Is Waldo?

A Project By Melanie Coles

the Serious Computer Vision Blog

A blog about computer vision and serious stuff

Cauthy's Blog

paper review...

Cornell Computer Vision Seminar Blog

Blog for CS 7670 - Special Topics in Computer Vision


Life through nerd-colored glasses

Luciana Haill

Brainwaves Augmenting Consciousness



Dr Paul Tennent

and the university of nottingham

turn off the lights, please

A bunch of random, thinned and stateless thoughts around the Web

%d bloggers like this: