Getting Started

Laying down the ground work

Rounting Error

  • uninitialized constant ArticlesController
    • the route needs to have a controller defined in order to serve the request.//无controller

Read more


layout: post title: Knowledge points collection description: “knowledge points collection, skills” tags: [collection,javascript] image: background: triangular.png comments: true share: true —

点击区域外,隐藏元素

$(document).click(function(e){
                e = window.event || e; // 兼容IE7
                var obj = $(e.srcElement || e.target);

                $(obj).is('.trigger') || $('.target').css('display', 'none');
				
	            // or this to dismiss multi elements
                $(obj).is('.trigger') || $(obj).is('.trigger2')  || (function(){
                    self.dom.find('.formTable').css('display', 'none');
                    self.dom.find('.selectTable').css('display', 'none');
                }());
            });

click and mousedown 的冒泡问题

mousedown 先于 click触发, 若在冒泡触发时return false 则click不会触发,

code:

$('container').on('click', 'inner-element', function(){
	//codes here...
});
$('container').on('mousedown', 'inner-element', function(e){
	e.stopPropagation();
});

$('container').on('mousedown', 'outer-element', function(){
	//... 
});

Read more

API

Define a class

var Person = Class(
	  constructor: function(name, age){
	    this.name = name;
		this.age  = age;
	  },

      toString: function(){
	    return this.name + '/' + this.age;
	  } 


	);

	var person = new Person('Rika', 20);
	person.toString();  // "Rika/20"

Read more

特殊符号

. #[data] > + ^ () * $*

bootstrap navbar

.navbar[role=navigation]>.container>(.navbar-header>(button.navbar-toggle>span.sr-only+span.icon-bar3)+a.navbar-brand[href=#])+(.collapse#my-navbar-collapse>ul.nav>(li>a[href=#])4+.dropdown>(a>b.caret)+(ul.dropdown-menu>(li>a[href=#])*6))

Read more

ido

Backspace 向上

C-r / C-s 移动

Read more