사용자:LL/common.js: 두 판 사이의 차이

잔글편집 요약 없음
잔글편집 요약 없음
29번째 줄: 29번째 줄:
} );
} );
} );
} );
$( 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' );
}
} );
} );
} );
} );

2017년 11월 28일 (화) 22:22 판

$( 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' );
	}
} );
} );

} );
} );