EXPERIENCE/WEB | HTML5&JS&CSS(12)
-
[JS] Array.Sort() 사용하기
#제공 데이터 중 최신컨텐츠 우선으로 정렬하고, 정렬순번으로 오름차순으로 정렬하기 d.list.sort((a,b) => a.newYn > b.newYn ? -1 : (a.sortNum > b.sortNum ? 1:-1)); - 사용방법 [].sort(conditionFunction); //1,2,3,8,9 오름차순 var arr = [2, 9, 8, 3, 1] print(arr.sort()); //9,8,3,2,1 내림차순 //#1 var arr = [2, 9, 8, 3, 1]; console.log(arr.sort(function(a,b){ return b-a; })); //#2 var arr = [2, 9, 8, 3, 1]; console.log(arr.sort(orderByDesc)); functi..
2019.09.04 -
[JS] JSON.parse : Convert this string into array of objects
convert this string into array of objects using the JSON native parser, as it is not only faster than the eval(), it's also more secure. Native JSON parser is already available in: Firefox 3.5+ IE 8+ Opera 10.5+ Safari Safari 4.0.3+ Chrome (don't know which version) var myJSONString = '{ "a": 1, "b": 2 }'; myObject = JSON.parse(myJSONString); http://stackoverflow.com/questions/3473639/best-way-t..
2016.08.20 -
Get Start Less
http://lesscss.org/ Getting StartedLess is a CSS pre-processor, meaning that it extends the CSS language, adding features that allow variables, mixins, functions and many other techniques that allow you to make CSS that is more maintainable, themable and extendable.Less runs inside Node, in the browser and inside Rhino. There are also many 3rd party tools that allow you to compile your files and..
2014.09.02 -
.prependTo()
Create a new li element : $('');Select the h2 element nested insind the ... element. : $('.article h2');
2014.08.22 -
make an Interactive Website 5 coding
PreviewLet's use jQuery to build a news reader.The file index.html contains the page structure and contentThe file style.css has the styling for the pageClick on the first article.Use the n keyboard shortcut to go to the next article.Then use the o keyboard shortcut to open the article description.If you have issues, check out the hint!Click Save & Submit Code to get started!Click on the first a..
2014.08.22 -
margin by codecademy
marginThe properties margin-left, andmargin-right are available to set themargin on either side of an HTML element. If one of these properties is set to auto, then it will take as much as possible.To move the HTML element to the far left of the screen, use margin-right: auto. This will maximize the amount of space there is on the right side margin, pushing the element to the far left.To center a..
2014.08.21