PageSourceSearch

https://www.nyanimon.com/js/common.js

js nyanimon.com collected 2026-10-07 10:55:13 UTC 1,810 bytes, 84 lines download raw bytes

1/*
2 * rollover.js
3 */
4(function($){
5	$.fn.initRollovers = function(o) {
6		var onfile = '_on';
7		var selectfile = '_select';
8		var body = $('body');
9		
10		return this.each(function(i) {
11			var e = $(this);
12			var src = e.attr('src');
13			var ftype = src.substring(src.lastIndexOf('.'), src.length);
14			var onsrc = src.replace(ftype, onfile + ftype);
15			var selectsrc = src.replace(ftype, selectfile + ftype);
16			var PreLoad = [];
17			
18			if(!src.match(onfile) && !src.match(selectfile)){
19				PreLoad[i] = new Image();
20				PreLoad[i].src = onsrc;
21				
22				e.hover(function(){
23					e.attr('src', onsrc);
24				}, function(){
25					e.attr('src', src);
26				});
27			}
28		});
29	};
30})(jQuery);
31
32function pageToTop(className) {
33    var topBtn = $(className);
34    //スクロールしてトップ
35    topBtn.click(function () {
36        $('body,html').animate({
37            scrollTop: 0
38        }, 500);
39        return false;
40    });
41}
42
43function staticHeader() {
44	$(window).scroll(function () {
45		if ($(this).scrollTop() > 96) {
46			$('.header--mini').addClass('fixed');
47		} else {
48			$('.header--mini').removeClass('fixed');
49		}
50	});
51}
52
53var smoothScroll = function () {
54	$('a[href^=#]').click(function(){
55		var href= $(this).attr("href");
56		var target = $(href == "#" || href == "" ? 'html' : href);
57		var position = target.offset().top;
58		$("html, body").animate({scrollTop:position}, 200);
59		return false;
60	});
61};
62
63var randomizeSlide = function () {
64	var arr = [];
65	$(".swiper-wrapper .swiper-slide").each(function() {
66		arr.push($(this));
67	});
68	arr.sort(function() {
69		return Math.random() - Math.random();
70	});
71	$(".swiper-wrapper").empty();
72	for(i=0; i < arr.length; i++) {
73		$(".swiper-wrapper").append(arr[i]);
74	}
75};
76
77
78$(function(){
79	$('.rover').initRollovers();
80    staticHeader();
81	smoothScroll();
82
83	randomizeSlide();
84});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.