일정위치에서 상단으로 스크롤되는 스크립트

2016. 3. 15. 17:37 Web/Mobile

<p class="goTop"><a href="#">맨위로</a></p> 

 




.goTop {

  width: 42px;

  height: 42px;

  background: #5acbd7;

  border-radius: 50%;

  opacity: 0.7;

  z-index: 100;

  a {

    display: block;

    padding-top: 22px;

    padding-top: 2.2rem;

    color: #fff;

    text-align: center;

    font-size: 11px;

    background: url("../../images/mo/ico_gnb.png") no-repeat 0 0;

    background-size: 320px 400px;

    background-position: -32px -137px;

  }

}

 



<script>

$(".goTop").hide();

$('.goTop').click(function(){

$('html, body').animate({scrollTop:0}, 300);

});

$(window).scroll(function(){

var conH = $("footer").height() + 90;

temp = $(window).scrollTop();

if( temp = $(window).scrollTop() ) {

$(".goTop").fadeIn();

} else {

$(".goTop").fadeOut();

}

$(".goTop").css({"position" : "fixed" , "bottom" : conH + "px" , "right" : "5px"});

});

</script>


'Web > Mobile' 카테고리의 다른 글

일정위치에서 부드럽게 스크롤되는 toTop 플러그인  (0) 2016.03.15
[JQuery UI]버튼 UI  (0) 2013.01.25
[JQuery UI]폼 UI  (0) 2013.01.25
[JQuery UI]콘텐츠 영역 접이식 패널  (0) 2013.01.25
간편한 header, footer  (0) 2013.01.25

일정위치에서 부드럽게 스크롤되는 toTop 플러그인

2016. 3. 15. 17:16 Web/Mobile

<div id="wrapper"></div>



#toTop {

display:none;

text-decoration:none;

position:fixed;

bottom:10px;

right:10px;

overflow:hidden;

width:51px;

height:51px;

border:none;

text-indent:100%;

background:url(../img/ui.totop.png) no-repeat left top;

}


#toTopHover {

background:url(../img/ui.totop.png) no-repeat left -51px;

width:51px;

height:51px;

display:block;

overflow:hidden;

float:left;

opacity: 0;

-moz-opacity: 0;

filter:alpha(opacity=0);

}


#toTop:active, #toTop:focus {

outline:none;

}




<script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>

<script src="js/easing.js" type="text/javascript"></script>

<script src="js/jquery.ui.totop.js" type="text/javascript"></script>

<script type="text/javascript">

$(document).ready(function() {

/*

var defaults = {

  containerID: 'toTop', // fading element id

containerHoverID: 'toTopHover', // fading element hover id

scrollSpeed: 1200,

easingType: 'linear' 

  };

*/

$().UItoTop({ easingType: 'easeOutQuart' });

});

</script>

Download: http://mattvarone.com/web-design/uitotop-jquery-plugin/

'Web > Mobile' 카테고리의 다른 글

일정위치에서 상단으로 스크롤되는 스크립트  (0) 2016.03.15
[JQuery UI]버튼 UI  (0) 2013.01.25
[JQuery UI]폼 UI  (0) 2013.01.25
[JQuery UI]콘텐츠 영역 접이식 패널  (0) 2013.01.25
간편한 header, footer  (0) 2013.01.25

[JQuery UI]버튼 UI

2013. 1. 25. 12:07 Web/Mobile


1. 버튼에 아이콘 넣기
1.1 아이콘 설정: data-icon
  <button data-icon="arrow-l">data-icon="arrow-l"</button> //왼쪽방향 화살표
  <button data-icon="arrow-r">data-icon="arrow-r"</button> //오른쪽방향 화살표
  <button data-icon="arrow-u">data-icon="arrow-u"</button> //위쪽방향 화살표
  <button data-icon="arrow-d">data-icon="arrow-d"</button> //아리쪽방향 화살표
  <button data-icon="delete">data-icon="delete"</button>// 삭제
  <button data-icon="plus">data-icon="plus"</button>
  <button data-icon="minus">data-icon="minus"</button>
  <button data-icon="check">data-icon="check"</button>
  <button data-icon="gear">data-icon="gear"</button>
  <button data-icon="refresh">data-icon="refresh"</button>
  <button data-icon="forward">data-icon="forward"</button>
  <button data-icon="back">data-icon="back"</button>
  <button data-icon="grid">data-icon="grid"</button>
  <button data-icon="star">data-icon="star"</button>
  <button data-icon="info">data-icon="info"</button>
  <button data-icon="home">data-icon="home"</button>
  <button data-icon="search">data-icon="search"</button> //돋보기



1.1 아이콘 위치변경 : data-iconpos="righr/left/top/bottom"
   <button data-icon="star" data-iconpos="top"> data-iconpos="top"</button>


2. 링크를 버튼으로 사용하기
2.1 버튼으로 지정
<a href="index.html" data-role="button">button 1</a>

2.2 버튼 그룹화
: 수평상태로 나열  data-type="horizontal"
   <div data-role="controlgroup" data-type="horizontal">
    <a href="index.html" data-role="button">button 1</a>
    <a href="index.html" data-role="button">button 2</a>
    <a href="index.html" data-role="button">button 3</a>
   </div>



참고: http://view.jquerymobile.com/1.3.2/dist/demos/widgets/icons/
http://view.jquerymobile.com/1.3.2/dist/demos/widgets/buttons/ 

[JQuery UI]폼 UI

2013. 1. 25. 11:51 Web/Mobile


1. 제이쿼리 모바일 폼UI를 이용하기 위해서는 감싸는 영역에 data-role="fieldcontain"을 지정해야 한다

  <div data-role="content">
   <div data-role="fieldcontain">
//한줄 텍스트
: 기본 브라우저 UI 사용할 경우 data-role="none"
     <label for="">„</label>
     <input type="text/password/email/url/tel/number" id="">

//검색영역
     <label for="search">‰</label>
     <input type="search" id="search">

//두줄이상 텍스트
     <label for="contact"></label>
     <textarea id="contact"></textarea>

//슬라이더
     <label for="year">…„</label>
     <input type="range" name="year" id="year" value="1980" min="1900" max="2013" />

//두개중 하나 선택 슬립 스위치
      <label for="gender">성별</label>
      <select name="gender" id="gender" data-role="slider">
        <option value="남자">남자</option>
        <option value="여자">여자</option>
      </select> 

//라디오버튼: 디폴트는 세로...
      <fieldset data-role="controlgroup" data-type="horizontal">
        <legend>구입횟수</legend>
        <input type="radio" name="number" id="n1" value="1번" checked="checked" />
        <label for="n1">1번</label>
        <input type="radio" name="number" id="n2" value="2번" />
        <label for="n2">2번</label>
        <input type="radio" name="number" id="n3" value="3번" />
        <label for="n3">3번</label>
        <input type="radio" name="number" id="n4" value="4번" />
        <label for="n4">4번 이상</label>
      </fieldset>

//체크박스
      <fieldset data-role="controlgroup">
        <legend>주제별 문의</legend>
        <input type="checkbox" name="type1" id="type1" value="HP 신규작성">
        <label for="type1">HP 신규작성</label>
        <input type="checkbox" name="type2" id="type2" value="HP 리뉴얼">
        <label for="type2">HP 리뉴얼</label>
        <input type="checkbox" name="type3" id="type3" value="시스템 개발">
        <label for="type3">시스템 개발</label>
        <input type="checkbox" name="type4" id="type4" value="컨설팅">
        <label for="type4">컨설팅</label>
      </fieldset>

//셀렉트메뉴
: 팝업으로뜨게 할 경우 data-native-menu="false"
: 복수 지정 가능 multiple="multiple"
     <label for="number">구입횟수</label>
     <select name="number" id="number" multiple="multiple" data-native-menu="false">
       <option value="">선택하세요.</option>
       <option value="n1">1번</option>
       <option value="n2">2번</option>
       <option value="n3">3번</option>
       <option value="n4">4번 이상</option>
     </select>

//버튼영역
: 버튼크기를 문자에 맞추기 data-inline="true"
    <input type="button" value="취소" data-theme="" data-icon="delete">
    <input type="submit" value="전송" data-theme="" data-icon="arrow-r">
   </div>
  </div>


참고: http://view.jquerymobile.com/1.3.2/dist/demos/widgets/forms/

'Web > Mobile' 카테고리의 다른 글

일정위치에서 부드럽게 스크롤되는 toTop 플러그인  (0) 2016.03.15
[JQuery UI]버튼 UI  (0) 2013.01.25
[JQuery UI]콘텐츠 영역 접이식 패널  (0) 2013.01.25
간편한 header, footer  (0) 2013.01.25
폼 UI 기본  (0) 2013.01.24

[JQuery UI]콘텐츠 영역 접이식 패널

2013. 1. 25. 11:23 Web/Mobile

1. 접이식 패널
1.1 접힌형식이 디폴트
  <div data-role="content">
   <div data-role="collapsible" data-collapsed="false">
     <h3>접이식 패널</h3>
     <p>클릭하면 패널이 닫힙니다.</p>
   </div>
  </div>

1.2 다중 접이식 패널
  <div data-role="content">
   <div data-role="collapsible-set">
     <div data-role="collapsible">
       <h3>패널 1</h3>
       <p>패널 1이 열립니다.</p>
     </div>
     <div data-role="collapsible">
       <h3>패널 2</h3>
       <p>패널 2가 열립니다.</p>
     </div>
     <div data-role="collapsible">
       <h3>패널 3</h3>
       <p>패널 3이 열립니다.</p>
     </div>
   </div>
  </div>


참고: http://view.jquerymobile.com/1.3.2/dist/demos/widgets/accordions/ 

'Web > Mobile' 카테고리의 다른 글

[JQuery UI]버튼 UI  (0) 2013.01.25
[JQuery UI]폼 UI  (0) 2013.01.25
간편한 header, footer  (0) 2013.01.25
폼 UI 기본  (0) 2013.01.24
구글맵 API  (0) 2013.01.24
Copyright © HuckleberryM All Rights Reserved | JB All In One Designed by CMSFactory.NET