Skip to content

Instantly share code, notes, and snippets.

@dstyle0210
dstyle0210 / gist:6f3b954106726d2f1473
Created July 28, 2014 04:44
이미지 랜덤으로 뿌리기, 단 이전 이미지를 기억하여 똑같이 보이지는 않도록.
//<![CDATA[
$(function(){
var $wrap = $("#js-section0101");
var imageArr = ["/asan/images/main/section0101_bg.png", "/asan/images/main/section0101_bg2.png", "/asan/images/main/section0101_bg3.png"];
var oldNum;
var num = ~~(Math.random()*imageArr.length);
if(window.localStorage){
oldNum = Number(window.localStorage.getItem('section0101_ranomNum'));
@dstyle0210
dstyle0210 / gist:8a88e254b864baf192c5
Created July 28, 2014 08:04
셀렉트의 옵션에서 font-family가 안먹는 현상 정리.
참고 : http://ogelacinyc.tistory.com/63
단순하게 정리하면,
웹폰트로 select내의 option을 적용하려할때.
IE8은 무조건 시스템 폰트을 인정 => 즉 나눔고딕을 시스템폰트로 설치해야만 보여짐.
그외는 select의 font-family속성을 인정.
@dstyle0210
dstyle0210 / gist:2bb721c77a6ccec59363
Created July 30, 2014 03:09
기본 HTML 템플릿 구조. : WEB용.
<!DOCTYPE html>
<html lang="ko" xml:lang="ko">
<head>
<title>타이틀명 입력.</title>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<meta name="viewport" content="width=1240">
<!--=== FOR FACEBOOK ===-->
@dstyle0210
dstyle0210 / gist:cb7335b26e99b704bd47
Created July 30, 2014 04:10
HTML기본소스 : 모바일.
<!DOCTYPE html>
<html lang="ko">
<head>
<title>타이틀명.</title>
<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, address=no, email=no" />
@dstyle0210
dstyle0210 / jquery.onoff.js
Last active August 29, 2015 14:04
이미지 온오프 함수
//jQuery Extend image OnOff : dstyle
//이미지 배열에서 특정 인덱스만 온으로 바꿈.
(function($){
$.fn.onoff = function(opt){
var o={
idx:0,
ext:"gif",
sep:"On"
};
(($.type(opt)=="object")?$.extend(o,opt):(o.idx = opt+""));
@dstyle0210
dstyle0210 / jquery.unclick.js
Last active August 29, 2015 14:04
a의 href가 있어도 실행하지 않는 구문. return false;
//jQuery Extend unClick : dstyle
//href가 있을때 이벤트가 없어지도록 처리
(function($){
$.fn.unclick = function(){
this.each(function(n,m){
m.onclick=function(){
return false;
}
});
return this;
@dstyle0210
dstyle0210 / jquery.addIdx.js
Created July 30, 2014 04:25
this.idx을 적용하는 메소드.
//jQuery Extend addIdx : dstyle
//each가 가능한 오브젝트에 .idx 라는 값을 넣는다. 이건 자신의 인덱스 순서.
(function($){$.fn.addIdx = function(s){var s=(!s)?"idx":s;$(this).each(function(n,m){m[s] = n;});return this;};})(jQuery);
@dstyle0210
dstyle0210 / jquery.ie7.zIndex.js
Created July 30, 2014 04:26
IE7 전용 div의 z-index 역으로 적용.
//jQuery Extend relativeSet : dstyle
//IE7을 위해 position z-index순서를 적용해줌.
(function($){$.fn.relativeSet=function(){$(this).each(function(i){$(this).css({"position":"relative","z-index":(99999-i)});});};})(jQuery);
@dstyle0210
dstyle0210 / jquery.dHeight.js
Created July 30, 2014 04:26
윈도우 높이와 문서의 높이를 비교하여 큰것을 리턴.
//jQuery Extend dHeight : dstyle
// 윈도우 높이와 문서의 높이를 비교하여 큰것을 리턴.
(function($){$.windowHeight = function(){return (($(window).height()>$(document.body).height())?$(window).height():$(document.body).height());};})(jQuery);
@dstyle0210
dstyle0210 / s_del.css
Last active August 29, 2015 14:04
s엘리먼트나 del엘리먼트 대신 사용해야 하는 CSS코드
/*
http://www.w3schools.com/cssref/playit.asp?filename=playcss_text-decoration&preval=line-through
s : 취소선 이라는 의미(strikethrough text.)
del : 삭제됨 이라는 의미 (delete)
만약 쇼핑몰에서 원가를 할인하여, 제공하는 경우, 원가 라는 개념은 남기 떄문에, del을 사용할순 없다. 그렇기 떄문에 CSS만으로 처리함.
/
div{text-decoration:line-through;}