Skip to content

Instantly share code, notes, and snippets.

@ace4gi
ace4gi / window.console
Last active August 29, 2015 13:57
console 미지원시 에러 없게 처리
if( ! window.console ){ console = { log : function(){} }; }
@ace4gi
ace4gi / $.browser
Last active August 29, 2015 13:57
브라우저 scroll시 scoll 루트 요소 찾기
(function($) {
$.extend({
// jquery 브라우저 구분 코드 (jquery 1.8.3 버전의 jQuery.broswer)
// 아래의 코드가 필요하면 자신의 클래스에 붙여서 사용하면됨~!
// Use of jQuery.browser is frowned upon.
// More details: http://api.jquery.com/jQuery.browser
// jQuery.uaMatch maintained for back-compat
browser : (function(){
function uaMatch( ua ) {
ua = ua.toLowerCase();
@ace4gi
ace4gi / jQuery - Flugin format
Last active August 29, 2015 13:59
jQuery - Flugin format
;(function($){
'use strict';
if (!Raphael) { throw new Error("jquery.PluginName.js - requires xxx"); }
var PluginName = function(element, _options){
this.$element = $(element);
this.options = _options;
}
@ace4gi
ace4gi / imagesLoaded
Last active August 29, 2015 14:00 — forked from paulirish/README.md
// $('img.photo',this).imagesLoaded(myFunction)
// execute a callback when all images have loaded.
// needed because .load() doesn't work on cached images
// mit license. paul irish. 2010.
// webkit fix from Oren Solomianik. thx!
// callback function is passed the last image to load
// as an argument, and the collection as `this`
@ace4gi
ace4gi / gist:38f338ba5b9c4d96721f
Created July 15, 2014 01:05
mobile - minHeight 100% layout
$(document).ready(function(){
if( $("body").hasClass("layout-static") ){
return;
}
var $wrap = $("#contwrap");
var $header = $wrap.find(">header:first");
var $footer = $wrap.find(">footer:first");
var $container = $("#container");
@ace4gi
ace4gi / gist:e17606372925af0510b7
Created July 15, 2014 01:12
webFont.css (NanumGothic)
html - <head>
(function($){
var userAgent = navigator.userAgent.toLowerCase();
if( userAgent.indexOf('safari') != -1 && userAgent.indexOf('version') != -1 ){
// safari(중문표현 가능한 나눔고딕 폰트로 대체(.ttf, .otf)
document.write('<link href="${cp}/css/webFont.css" rel="stylesheet" type="text/css" />');
}else{
document.write('<style type="text/css">@import url(https://fonts.googleapis.com/earlyaccess/nanumgothic.css);</style>');
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=medium-dpi" />
<meta name="format-detection" content="telephone=no" />
<link rel="shortcut icon" href="http://html5.cafe24.com/favicon48x48.ico" /><!-- size:48x48 -->
<link rel="apple-touch-icon" href="http://html5.cafe24.com/favicon114x114.png" /><!-- size:114x114 -->
</head>
@ace4gi
ace4gi / gist:6230b07907f58d67c226
Last active August 29, 2015 14:04
단어 자르기/정렬
/* 단어잘림 테스트 */
word-break: break-all; /* 모든 단어 짤림 */
word-wrap: break-word; /* 화면을 긴 단어 짤림(예:url) */
/* 한글/영문 단어 유지하면서 양쪽 정렬하기 */
/* ie8 확인했음 */
word-break:keep-all; text-align:justify;
@ace4gi
ace4gi / gist:b5d1e29d598d435b7200
Created July 27, 2014 18:25
animate 0 - 1 (easing)
jQuery({count:0}).animate({count:1}, {
duration: 1000,
progress: function() {
console.log( this.count );
}
});
@ace4gi
ace4gi / gist:0b70df3bcd2c3f35c723
Last active August 29, 2015 14:07
normalize.css + scaffolding.css
@charset "UTF-8";
@font-face {
font-family:NanumBarunGothic; font-style:normal; font-weight:600;
src:url(/mart/common/font/NanumBarunGothicBold.eot);
src:url(/mart/common/font/NanumBarunGothicBold.eot?#iefix) format('embedded-opentype'), url(/mart/common/font/NanumBarunGothicBold.woff) format('woff'), url(/mart/common/font/NanumBarunGothicBold.ttf) format('truetype');
}
@font-face {
font-family:NanumBarunGothic; font-style:normal; font-weight:400;
src:url(/mart/common/font/NanumBarunGothic.eot);