본문 바로가기

Web/Javascript

(29)
JavaScript - SORT sort () 메서드는 배열의 요소를 적절한 위치에 정렬하고 배열을 반환합니다. 종류가 반드시 안정적 일 필요는 없습니다. 기본 정렬 순서는 문자열 유니 코드 코드 포인트에 따릅니다. arr.sort() arr.sort(compareFunction) var fruit = ['cherries', 'apples', 'bananas']; fruit.sort(); // ['apples', 'bananas', 'cherries'] var scores = [1, 10, 21, 2]; scores.sort(); // [1, 10, 2, 21] // 10이 2, // Unicode 코드 포인트 순서에서 '10'이 '2'앞에 오기 때문에. var things = ['word', 'Word', '1 Word', '2 Wo..
JavaScript - MAP map() 메소드는 파라미터로 전달 된 함수를 통하여 배열 내의 각 요소를 처리해서 그 결과로 새로운 배열을 생성합니다. arr.map(callback, [thisArg]) callback 새로운 배열의 요소를 생성하는 함수로서, 다음 세가지 인수를 가집니다. currentValue 현재 처리되고 있는 요소 index 현재 처리되고 있는 요소의 index 값 array 메소드가 불려진 배열 thisArg (선택항목) callback 함수 내부에서 사용 할 this 값을 설정 var numbers = [1, 2, 3, 4, 5]; var processed = numbers.map(function(num){ return num*num; }); /* ES6 Syntax */ let numbers = [1, 2..
2016년에 자바스크립트를 배우는 기분 http://www.looah.com/article/view/2054
JS 라이브러리 - 모션 관련animate css : http://daneden.me/animatecurtain js : https://github.com/Victa/curtain.jsfullpage js : http://alvarotrigo.com/fullPage/ - 테이블 요소 관련http://datatables.net - 레이어 이미지 확대http://fancybox.net - 가변폭 레이아웃http://isotope.metafizzy.cohttp://masonry.desandro.com/ - setTimeout 강화http://benalman.com/projects/jquery-dotimeout-plugin - 가로 스크롤http://www.pixxelfactory.net/jInvertScroll - 참고htt..
jQuery.browser $(document).ready(function () { //...생략 if($.browser.msie){ } if($.browser.iOS){ $("h1").append(" with iOS"); } if($.browser.Android){ $("h1").append(" with Android"); } if($.browser.WindowsPhone){ $("h1").append(" with Windows Phone"); } }); $(document).ready(function () { //...생략 if($.browser.msie){ var ieVersion = $.browser.version; if(ieVersion = 9.0){ alert('over 9.0'); } } //...생략 });