잔글 (test) |
잔글편집 요약 없음 |
||
18번째 줄: | 18번째 줄: | ||
'-ms-user-select': 'none' | '-ms-user-select': 'none' | ||
} ).click( function() { | } ).click( function() { | ||
$searchform.searchInput.value = "리브레 위키"; | $(searchform.searchInput.value = "리브레 위키"); | ||
} ); | } ); | ||
2017년 11월 23일 (목) 19:33 판
$( function() {
'use strict';
$( 'body' ).append( '<span id="to-top" style="font-size:20pt; color:pink;" >△</span>' );
var $topButton = $( '#to-top' );
$topButton.css( {
'color': 'black',
'position': 'fixed',
'bottom': '-30px',
'left': '4px',
'cursor': 'pointer',
'transition': 'bottom 0.5s',
'-webkit-transition': 'bottom 0.5s',
'user-select': 'none',
'-webkit-user-select': 'none',
'-moz-user-select': 'none',
'-ms-user-select': 'none'
} ).click( function() {
$(searchform.searchInput.value = "리브레 위키");
} );
$( window ).scroll( function() {
if ( $( window ).scrollTop() > 100 ) {
$topButton.css( 'bottom', '4px' );
} else {
$topButton.css( 'bottom', '-30px' );
}
} );
} );
$( function() {
'use strict';
$( 'body' ).append( '<span id="to-bottom" style="font-size:20pt; color:pink;" >▽</span>' );
var $bottomButton = $( '#to-bottom' );
var height=document.body.scrollHeight;
var hminus=document.body.scrollHeight-"650";
$bottomButton.css( {
'color': 'black',
'position': 'fixed',
'bottom': '-30px',
'left': '42pt',
'cursor': 'pointer',
'transition': 'bottom 0.5s',
'-webkit-transition': 'bottom 0.5s',
'user-select': 'none',
'-webkit-user-select': 'none',
'-moz-user-select': 'none',
'-ms-user-select': 'none'
} ).click( function() {
$( 'html, body' ).animate( { scrollTop:height}, 'slow' );
} );
$( window ).scroll( function() {
if ( $( window ).scrollTop () <hminus ) {
$bottomButton.css( 'bottom', '4px' );
} else {
$bottomButton.css( 'bottom', '-30px' );
}
} );
} );