준비물: (jQuery) 연결하기 이 블로그에 적용되어 있다.HTML에서 로딩 메시지 코드를 추가한다. 문서 상단에 추가할 수록 빨리 보인다. 바로 밑에 넣어도 된다. 로딩 중... CSS에 추가한다. #loading { border: 1px #000 solid; background-color: #eee; font-size:20pt !important; color:#000; text-align:center; top: 50%; left: 50%; padding-top: 10px; margin: -100px 0 0 -50px; width: 200px; height: 100px; z-index:10; position: absolute; } width, height를 알맞게 바꾼 후, margin의 top, l..
준비물: (jQuery) 연결하기 미리보기 http://simulz.com/tag 관련글: (jQuery) 티스토리 태그 목록 컬러풀하게~ 새로고침할 때마다 목록이 섞인다. ABC, 가나다였던 태그 목록을 랜덤 정렬로 변경해보았다. $.shuffle Plugin http://mktgdept.com/jquery-shuffle 위 사이트에서 js 파일을 내려 받고 사이트나 블로그에 업로드 한다. HTML HEAD에 아래 코드를 추가하여 JS를 연결한다. $('.taglog li').shuffle(); $('.taglog li') taglog 클래스를 가진 요소의 자식 중에서 li 요소들을 선택한다. $.shuffle(selector) 처럼 사용 가능하다.
준비물: (jQuery) 연결하기 미리보기 http://simulz.com/tag 새로고침 할 때마다 색상과 크기가 변한다. 많아야 5가지 색상과 크기뿐이었던 태그 목록을 랜덤 색상, 크기로 변경해보았다. 목록 섞기: (jQuery) 태그 목록 섞기 var getRandomRGB = function() { return '#' + Math.floor(Math.random()*16777216).toString(16); } var getRandomNumber = function(f, t) { var num = -1; while(f > num) num = Math.floor(Math.random() * (t+1)); return num; } $('.taglog li a').each(function() { $(t..
준비물: (jQuery) 연결하기 달력의 토요일을 아래처럼 파란색으로 변경해보자. $('.tt-calendar tr :nth-child(7)').removeClass('cal_day3').css('color','#0000ff'); $('.tt-calendar tr') tt-calendar 클래스를 가진 요소의 자식 중에서 tr 요소의 자식 요소들을 선택 :nth-child(index) 7번째 자식 요소(tr의 자식은 td)를 선택 .removeClass(class) 필요없는 내용이지만 확실히 해주려고... cal_day3 클래스를 제거한다. .css(key, value) color 속성의 값을 #0000ff 로 지정한다.