本文实例讲述了jquery+html5烂漫爱心表白动画代码。分享给大家供大家参考。具体如下:
jquery+html5烂漫爱心表白动画是一款jquery html5 canvas电子版的烂漫爱心表白动画,效果相当不错,非常有创意,很适合进行表白。
运行效果图:----------------------查看效果 下载源码-----------------------
小提示:浏览器中如果不能正常运行,可以尝试切换浏览模式。
为大家分享的jquery+html5烂漫爱心表白动画代码如下
jquery+html5烂漫爱心表白动画@font-face {
font-family: digit;
src: url('digital-7_mono.ttf') format("truetype");
}
/**
*2013—02-14,
*2013-02-28.
*/
Boy name = Mr LI
Girl name = Mrs ZHANG
// Fall in love river.
The boy love the girl;
// They love each other.
The girl loved the boy;
// AS time goes on.
The boy can not be separated the girl;
// At the same time.
The girl can not be separated the boy;
// Both wind and snow all over the sky.
// Whether on foot or 5 kilometers.
The boy very happy;
The girl is also very happy;
// Whether it is right now
// Still in the distant future.
The boy has but one dream;
// The boy wants the girl could well have been happy.
I want to say:
Baby, I love you forever;
亲爱的,这是我们相爱在一起的时光。
爱你直到永永远远。
var offsetX = $("#loveHeart").width() / 2;
var offsetY = $("#loveHeart").height() / 2 - 55;
var together = new Date();
together.setFullYear(2013, 2, 28);
together.setHours(20);
together.setMinutes(0);
together.setSeconds(0);
together.setMilliseconds(0);
if (!document.createElement('canvas').getContext) {
var msg = document.createElement("div");
msg.id = "errorMsg";
msg.innerHTML = "Your browser doesn't support HTML5!
Recommend use Chrome 14+/IE 9+/Firefox 7+/Safari 4+";
document.body.appendChild(msg);
$("#code").css("display", "none")
$("#copyright").css("position", "absolute");
$("#copyright").css("bottom", "10px");
document.execCommand("stop");
} else {
setTimeout(function () {
startHeartAnimation();
}, 5000);
timeElapse(together);
setInterval(function () {
timeElapse(together);
}, 500);
adjustCodePosition();
$("#code").typewriter();
}
以上就是为大家分享的jquery+html5烂漫爱心表白动画代码,希望大家可以喜欢。