hashchange event 해시 이벤트 버전 추가 : 1.0
설명 : 북마크 가능한 #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();
});
게시글 목록
| 번호 | 제목 |
|---|---|
| 1326 |
AngularJS
AngularJS Filters에 uppercase (대문자변환)
|
| 1325 |
AngularJS
AngularJS Scope 3
|
| 1324 |
AngularJS
AngularJS Scope 2
|
| 1323 |
AngularJS
AngularJS Scope 1
|
| 1322 | |
| 1321 | |
| 1320 |
AngularJS
AngularJS Controllers
|
| 1319 |
AngularJS
AngularJS Data Binding 2번째
|
| 1318 | |
| 1317 |
AngularJS
AngularJS ng-model Directive
|
| 1316 | |
| 1315 |
AngularJS
AngularJS Directives(지시문) - 데이터 바인딩
|
| 1314 |
AngularJS
AngularJS Directives(지시문)
|
| 1313 |
AngularJS
AngularJS 모듈 만들기
|
| 1312 |
AngularJS
앵큘러js 간단한 예제
|
| 1311 | |
| 1310 |
AngularJS
AngularJS Input Controls - Data-Binding
|
| 1309 |
AngularJS
AngularJS $event Object
|
| 1308 |
AngularJS
AngularJS Toggle, True/False
|
| 1307 |
AngularJS
AngularJS ng-click 지시문
|
| 1306 |
AngularJS
AngularJS 마우스 이벤트
|
| 1305 |
AngularJS
AngularJS 이벤트
|
| 1304 |
jQuery Mobile
scrollstart 이벤트
|
| 1303 |
jQuery Mobile
pageshow 이벤트
|
| 1302 |
jQuery Mobile
pageremove 이벤트
|
| 1301 |
jQuery Mobile
pageloadfailed 이벤트
|
| 1300 |
jQuery Mobile
pageload 이벤트
|
| 1299 |
jQuery Mobile
pageinit 이벤트
|
| 1298 |
jQuery Mobile
pagehide 이벤트
|
| 1297 |
jQuery Mobile
pagecreate
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기