1. 程式人生 > 其它 >頁尾程式碼html,部落格園頁尾 HTML 程式碼 .html

頁尾程式碼html,部落格園頁尾 HTML 程式碼 .html

style="position: fixed; left: 0px; top: 0px; z-index: 2147483647; pointer-events: none;">

var a_idx = 0;

jQuery(document).ready(function ($) {undefined

$("body").click(function (e) {undefined

var a = new Array(

"❤富強❤", "❤民主❤", "❤和諧❤", "❤文明❤",

"❤自由❤", "❤平等❤", "❤公正❤", "❤法治❤",

"❤愛國❤", "❤敬業❤", "❤誠信❤", "❤友善❤",

);

var $i = $("").text(a[a_idx]);

a_idx = (a_idx + 1) % a.length;

var x = e.pageX,

y = e.pageY;

$i.css({undefined

"z-index": 999999999999999999999999999999999999999999999999999999999999999999999,

"top": y - 20,

"left": x,

"position": "absolute",

"font-weight": "bold",

"color": "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"

});

$("body").append($i);

$i.animate({undefined

"top": y - 180,

"opacity": 0

}, 1500,

function () {undefined

$i.remove();

});

});

});

(function ($) {undefined

$.fn.snow = function (options) {undefined

var $flake = $('

documentHeight = $(document).height(),

documentWidth = $(document).width(),

defaults = {undefined

minSize: 10,

maxSize: 20,

newOn: 1000,

flakeColor: "#AFDAEF" /* 此處可以定義雪花顏色,若要白色可以改為#FFFFFF */

},

options = $.extend({}, defaults, options);

var interval = setInterval(function () {undefined

var startPositionLeft = Math.random() * documentWidth - 100,

startOpacity = 0.5 + Math.random(),

sizeFlake = options.minSize + Math.random() * options.maxSize,

endPositionTop = documentHeight - 200,

endPositionLeft = startPositionLeft - 500 + Math.random() * 500,

durationFall = documentHeight * 10 + Math.random() * 5000;

$flake.clone().appendTo('body').css({undefined

left: startPositionLeft,

opacity: startOpacity,

'font-size': sizeFlake,

color: options.flakeColor

}).animate({undefined

top: endPositionTop,

left: endPositionLeft,

opacity: 0.2

}, durationFall, 'linear', function () {undefined

$(this).remove()

});

}, options.newOn);

};

})(jQuery);

$(function () {undefined

$.fn.snow({undefined

minSize: 5, /* 定義雪花最小尺寸 */

maxSize: 50,/* 定義雪花最大尺寸 */

newOn: 300 /* 定義密集程度,數字越小越密集 */

});

});

本文來自學習小花,作者:aixuexi666888,轉載請註明原文連結:https://www.cnblogs.com/aixuexi666888/p/15509844.html