-
input file 디자인 입히기
<div class="filebox"> <input class="upload-name" value="파일선택" disabled="disabled"> <label for="ex_filename">업로드</label> <input type="file" id="ex_filename" class="upload-hidden"> </div> .filebox input[type="file"] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } .filebox label { display: inline-block; padding: .5em .75em; color: #999; font-size: inherit; line-height: normal; vertical-align: middle; background-color: #fdfdfd; cursor: pointer; border: 1px solid #ebebeb; border-bottom-color: #e2e2e2; border-radius: .25em; } /* named upload */ .filebox .upload-name { display: inline-block; padding:...
-
gitk 한글 깨짐 해결방법
gitbash 접속 명령어 입력 git config --global gui.encoding utf-8
-
addEventListener, attachEvent
addEventListener, attachEvent 두 메소드의 기능은 같지만 브라우저마다 지원하는 메소드가 다르기 때문에 분기 처리 해주어야 한다. /** addEventListener * * IE9+, chrome * @param type {string} //이벤트 타입을 구분하기 위한 문자열 (ex click, blur, drag, drop, ...) * @param function {obj} //이벤트를 수신하여 처리할 객체, 해당 객체는 EventListener 인테페이스를 구현하거나 단순한 자바스크립트 함수여야 한다. * @param useCapture {boolean} //true = Capturing, false = Bubling, default = false */ element.addEventListener(type, function[, useCapture]); /** attachEvent * * IE8...
-
iOS position fixed focus event issue
$.fn.mobileFix = function (options) { var $parent = $(this), $fixedElements = $(options.fixedElements); $(document) .on('focus', options.inputElements, function(e) { $parent.addClass(options.addClass); }) .on('blur', options.inputElements, function(e) { $parent.removeClass(options.addClass); // Fix for some scenarios where you need to start scrolling setTimeout(function() { $(document).scrollTop($(document).scrollTop()) }, 1); }); return this; // Allowing chaining }; // Only on touch devices if (Modernizr.touch) { $("body").mobileFix({ // Pass parent to apply to inputElements: "input, textarea", // Pass activation child elements addClass: "fixfixed" // Pass class...
-
자바스크립트 카운트다운
Pure Javascript Countdown Example (Minute&Second Base) function countdown( elementName, minutes, seconds ) { var element, endTime, hours, mins, msLeft, time; function twoDigits( n ) { return (n <= 9 ? "0" + n : n); } function updateTimer() { msLeft = endTime - (+new Date); if ( msLeft < 1000 ) { element.innerHTML = "countdown's over!"; } else { time = new Date( msLeft ); hours = time.getUTCHours(); mins = time.getUTCMinutes(); element.innerHTML = (hours ?...