제이쿼리 모바일 hashchange event
설명 : 북마크 가능한 #hash 기록을 사용하도록 설정합니다.
jQuery ( ".selector") .on ( "hashchange", function (event) {...})
jQuery Mobile .hashchange () 이벤트 핸들러는 window.onhashchange 이벤트에 바인딩 된 콜백 함수를 제공하여 매우 기본적인 북마크 가능한 #hash 기록을 가능하게합니다.
onhashchange 이벤트는 창 해시가 변경 될 때 발생합니다.
지원하는 브라우저에서는 기본 HTML5 window.onhashchange 이벤트가 사용됩니다.
IE6 / 7 (및 IE7 호환성 모드에서 작동하는 IE8)에서는 숨겨진 iframe이 만들어져 뒤로 버튼과 해시 기반 기록을 사용할 수 있습니다.
이 플러그인은 jQuery의 내장 메소드를 확장합니다.
jQuery Mobile이로드되어 있지 않으면 메서드가 계속 존재하므로 .hashchange () 메서드를 호출하는 것이 직접 실패하지 않을 수도 있습니다.
그러나 예상 된 동작이 발생하지 않습니다.
$(function() {
// Bind an event to window.onhashchange that, when the hash changes, gets the
// hash and adds the class "selected" to any matching nav link.
$( window ).hashchange(function() {
var hash = location.hash;
// Set the page title based on the hash.
document.title = "The hash is " + ( hash.replace( /^#/, "" ) || "blank" ) + ".";
// Iterate over all nav links, setting the "selected" class as-appropriate.
$( "#nav a" ).each(function() {
var that = $( this );
that[ that.attr( "href" ) === hash ? "addClass" : "removeClass" ]( "selected" );
});
});
// Since the event is only triggered when the hash changes, we need to trigger
// the event now, to handle the hash the page may have loaded with.
$( window ).hashchange();
});
설명 : 북마크 가능한 #hash 기록을 사용하도록 설정합니다.
jQuery ( ".selector") .on ( "hashchange", function (event) {...})
jQuery Mobile .hashchange () 이벤트 핸들러는 window.onhashchange 이벤트에 바인딩 된 콜백 함수를 제공하여 매우 기본적인 북마크 가능한 #hash 기록을 가능하게합니다.
onhashchange 이벤트는 창 해시가 변경 될 때 발생합니다.
지원하는 브라우저에서는 기본 HTML5 window.onhashchange 이벤트가 사용됩니다.
IE6 / 7 (및 IE7 호환성 모드에서 작동하는 IE8)에서는 숨겨진 iframe이 만들어져 뒤로 버튼과 해시 기반 기록을 사용할 수 있습니다.
이 플러그인은 jQuery의 내장 메소드를 확장합니다.
jQuery Mobile이로드되어 있지 않으면 메서드가 계속 존재하므로 .hashchange () 메서드를 호출하는 것이 직접 실패하지 않을 수도 있습니다.
그러나 예상 된 동작이 발생하지 않습니다.
$(function() {
// Bind an event to window.onhashchange that, when the hash changes, gets the
// hash and adds the class "selected" to any matching nav link.
$( window ).hashchange(function() {
var hash = location.hash;
// Set the page title based on the hash.
document.title = "The hash is " + ( hash.replace( /^#/, "" ) || "blank" ) + ".";
// Iterate over all nav links, setting the "selected" class as-appropriate.
$( "#nav a" ).each(function() {
var that = $( this );
that[ that.attr( "href" ) === hash ? "addClass" : "removeClass" ]( "selected" );
});
});
// Since the event is only triggered when the hash changes, we need to trigger
// the event now, to handle the hash the page may have loaded with.
$( window ).hashchange();
});
게시글 목록
| 번호 | 제목 |
|---|---|
| 1199 |
반응형웹
반응형웹 스크립트로 바꾸기
3
|
| 1197 |
반응형웹
반응형 레이아웃의 첫걸음 예제소스
|
| 1181 |
부트스트랩
부트스트랩 MIT 라이센스?
3
|
| 1165 |
부트스트랩
data-toggle 체크박스 활용
|
| 785 | |
| 455 | |
| 426 | |
| 311 | |
| 287 |
반응형웹
7. 서버측 반응형 웹 접근방법
17
|
| 247 |
반응형웹
6. 반응형 이미지
46
|
| 237 |
반응형웹
잠깐글2. 반응형 테이블
12
|
| 236 | |
| 220 |
반응형웹
5. 반응형 네비게이션/메뉴
25
|
| 215 | |
| 205 |
반응형웹
4. 반응형 레이아웃
21
|
| 179 |
반응형웹
3. 반응형 그리드
23
|
| 167 | |
| 133 | |
| 119 |
반응형웹
반응형 웹 강좌를 시작하며
33
|
| 108 | |
| 98 | |
| 86 | |
| 82 | |
| 64 | |
| 50 | |
| 46 | |
| 34 | |
| 1 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기