兰陵の记事簿

Tech Otakus Save The World

兰陵

2016年5月11日

代码>

大盗摸你傻,专偷金坷垃

有小伙伴对博客上咻咻咻的魔理沙很感兴趣,在这我就把这个源码分享出来

<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<style>
    #wsj{display: block;position: absolute;z-index: 999;left: -158px;top: 350px;}
    @media screen and (max-width: 700px){#wsj{display: none;}}
    body{overflow-x:hidden;}
</style>
<script>
	var wsjimg=new Image();
	wsjimg.src="http://7xk6om.com1.z0.glb.clouddn.com/mls1.png";
	wsjimg.id="wsj";
	wsjimg.onload=function  () {
		document.body.appendChild(wsjimg);
		window.setTimeout("wsja()",1000);
		window.setInterval("wsja()", 4000);
	}
	function wsja () {
		if (parseInt($("#wsj").css("left"),10)<0) {
			$("#wsj").css({"top":window.scrollY+250+"px","transform":"scalex(1)","transition":"all 0s"});
			$("#wsj").css({left:"1920px",top:window.scrollY+50+"px","transition":"all 1.0s"});
		};
		if (parseInt($("#wsj").css("left"),10)>=1920) {
			$("#wsj").css({"top":window.scrollY+250+"px","transform":"scalex(-1)","transition":"all 0s"});
			$("#wsj").css({left:"-158px",top:window.scrollY+50+"px","transition":"all 1.0s"});
		};
	}
</script>

说明:将以上放到。。。你喜欢的位置_(•̀ω•́ 」∠)_尽量在footer.php里吧。

需要引入jquery,已经引入的可忽略。如果主题是自适应移动设备的,会出现溢出,很影响体验。所以我用@media将其隐藏了DA☆ZE

大盗摸你傻,专偷金坷垃

谁用鼠标抓住了她,我请吃饭(๑•̀ω•́๑)

#一言#

来一发吐槽

  1. Pingback 滑天下之大稽的Typecho插件 - 雨落无声の地

Title - Artist
0:00