IE와 호환을 위해서는 css로는 안되고 javascript를 사용해야 한다.

 

아래 블로그 내용을 참조하였습니다.

http://blog.upgle.com/7670

 

  1. HTML5 Placeholder jQuery Plugin 다운받기

https://github.com/mathiasbynens/jquery-placeholder

 

  2. 데모페이지

http://mathiasbynens.be/demo/placeholder


  3. 사용방법

JQUERY를 삽입하는것만으로 자동으로 placeholder속성을 찾아 적용시켜줍니다. 정말 간단합니다!

$('input, textarea').placeholder();



IE 9 에서는 잘되고

IE 8 에서는 input type password type **** 로 나오므로 password 타입에 사용 할 때 고려해야 함.


감사합니다.

Posted by 마법수정화살
,

Glyphicons 

아이콘을 이미지로 표현 대신 폰트로 보여주어 고화질에서도 깔끔케 보이도록 하는 방법이다. 

Bootstrap 을 통해 사용하는 방법을 보자.

사용법

성능상의 이유로, 모든 아이콘은 기본클래스와 개개의 클래스를 필요로 합니다. 사용하려면, 다음의 코드를 어디든지 붙혀놓으면 됩니다. 적절한 패딩을 위해 아이콘과 글자 사이에 공간을 남겨두세요.

<span class="glyphicon glyphicon-search"></span>

예제

툴바와 네비게이션을 위해 버튼과 버튼 그룹에 그들을 사용하거나, 폼 입력요소 앞에 덧붙힙니다.

<button type="button" class="btn btn-default btn-lg">
  <span class="glyphicon glyphicon-star"></span> Star
</button>


Font Awesome

http://fortawesome.github.io/Font-Awesome/icons/

많은 아이콘을 제공한다 4.3.0 버전 519개 

- FA의 다양한 아이콘을 Glyphicons 으로 사용 할 수 있다. 


Instrumente 크롬 익스텐션을 사용하면 FA 아이콘과 class를 확인 할수 있는 항목이 있다. 


첨부된 파일을 받으면 확인해 볼 수 있습니다.

bootstrap + fontawesome

bootstrap.zip




Posted by 마법수정화살
,

어떤 영역에 스크롤 되면 이벤트를 발생 시킨다.


http://imakewebthings.com/waypoints/guides/getting-started/

웨이 포인트는 요소에 스크롤 할 때 기능을 트리거 할 수있는 가장 쉬운 방법입니다.


크롬에서 잘된다.


Jquery 1.8 이상

IE 9 이상

Posted by 마법수정화살
,

widget 컴포넌트 gridster

HTML 2015. 3. 18. 14:44

대시보드? 


http://gridster.net/#demos

데모페이지에 가보면 확인해 볼 수 있다. 


제공 되는 데모 화면.. 


드래그 해서 옵기면 촥촥 잘 붙는다~~

나중에 써먹어야지...


비슷한거.

http://mcpants.github.io/jquery.shapeshift/

Posted by 마법수정화살
,

carousel(캐러셀) UI

HTML 2015. 3. 17. 19:44
carousel은 수하물 컨베이어 벨트 라는 뜻, 회전목마 라는 뜻이 있다고 한다.  
돌고돈다는 것을 의미 하는듯..


위의 화면으로 어떤 ui를 생각 하게 되는가. 

1. 좌우 화살표를 누르면 다음장으로 이동.

2. 아래 동그라미를 누르면 해당 페이지로 이동

이 UI가 케러셀 이다. 

대부분 케러셀은 자동으로 움직이는 것을 지원하는 듯 하다.

아래 URL을 참조하면 예제와 소스코드를 구할 수 있다. 
확인해서 자신에게 맞는 컴포넌트를 가져다 쓰자. 

접근성 이슈 (bootstrap)

캐러셀 콤포넌트는 일반적으로 접근성 규약을 준수하지 않습니다. 당신이 준수할 필요가 있다면, 당신의 콘텐츠를 보여줄 수 있는 다른 옵션을 고려해 주세요.


bootstrap의 예제도 모바일에서 동작하는데 문제가 있다.


carousel 모바일 swipe (옆으로 쓸기) 이벤트. 

http://lazcreative.com/blog/adding-swipe-support-to-bootstrap-carousel-3-0/

Posted by 마법수정화살
,

아래 코드를 돌려보면 이유를 알수 있습니다. 

input form에서 엔터를 쳤을때.

1번 : 반응없음 

2번 : submit

3번 : button의 이벤트 발생 (여러개일때 가장 앞의 버튼의 이벤트 호출)

4번 : 반응없음.

FORM 안에 BUTTON을 사용한다면 type="button" 속성을 추가해야 합니다.


<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" > <title>button test</title> </head> <body class="account-save-page"> <h5>1. input밖에 없음.</h5> <form> <input type="text"> <input type="text"> <input type="text"> </form> <h5>1. input 과 버튼 (이벤트 없음.)</h5> <form> <input type="text"> <input type="text"> <input type="text"> <button>클릭</button> </form> <h5>1. input 과 버튼 (click 이벤트 있음)</h5> <form> <input type="text"> <input type="text"> <input type="text"> <button onclick="javascript:alert('alert!')">클릭</button> </form> <h5>1. input 과 버튼 속성 type="button"(click 이벤트 있음)</h5> <form> <input type="text"> <input type="text"> <input type="text"> <button type="button" onclick="javascript:alert('alert!')">클릭</button> </form> </body>

http://www.w3schools.com/tags/tag_button.asp 참조.
If you use the <button> element in an HTML form, different browsers may submit different values. Use <input> to create buttons in an HTML form.

button type = { button | submit | reset } 이고 브라우저마다 default type이 다를수 있네요. 
글고 IE8 Standards mode에서 default type=submit 이라고 하네요.

Remarks
The default value of the type attribute depends on the current document compatibility mode. The default value is submit. In other compatibility modes the default value is button.
When the BUTTON element is submitted in a form, the value depends on the current document compatibility mode.
Windows Internet Explorer 8 and later. The default value of the type attribute depends on the current document compatibility mode. In IE8 Standards mode, the default value is submit. In other compatibility modes and earlier versions of Windows Internet Explorer, the default value is button.


'HTML' 카테고리의 다른 글

ie9 이하에서의 placeholder 사용.  (0) 2015.03.18
bootstrap Glyphicons + font awesome  (0) 2015.03.18
jQuery Waypoints 스크롤 이벤트  (0) 2015.03.18
widget 컴포넌트 gridster  (0) 2015.03.18
carousel(캐러셀) UI  (0) 2015.03.17
Posted by 마법수정화살
,