📄 多合一的图片.txt
字号:
将下列代码复制到<head></head>之间:
<script>
<!--
// 图片的宽度(像素)
var imgwidth=250
// 图片的高度(像素)
var imgheight=350
// 图片的跑径
var imgurl="dog.jpg"
// 图片最终距离窗口左边的位置
var x_finalpos=10
// 图片最终距离窗口上端的位置
var y_finalpos=10
// 图片切分的数量
var imgslices=16
// 水平移动的速度
var step=40
var pause=10
var x_rightspans=0
var x_leftspans=0
var marginright
var marginleft
var height_slice=Math.floor(imgheight/imgslices)
var cliptop=0
var clipbottom=cliptop+height_slice
var clipleft=0
var clipright=imgwidth
var spannummer=0
var spannrbefore=0
function initiate() {
if (x_finalpos==-1) {
x_finalpos=Math.floor(document.body.clientWidth/2)-Math.floor(imgwidth/2)
}
if (document.all) {
moveslices_IE()
}
}
function moveslices_IE() {
if (x_rightspans==0 || x_leftspans==0) {
if (x_rightspans==0) {
for (i=0;i<=imgslices-1;i+=2) {
var thisspan=eval("document.all.span"+i+".style")
thisspan.posLeft-=step
}
if (thisspan.posLeft<=x_finalpos) {
x_rightspans=1
for (i=0;i<=imgslices-1;i+=2) {
var thisspan=eval("document.all.span"+i+".style")
thisspan.posLeft=x_finalpos
}
}
}
if (x_leftspans==0) {
for (i=1;i<=imgslices-1;i+=2) {
var thisspan=eval("document.all.span"+i+".style")
thisspan.posLeft+=step
}
if (thisspan.posLeft>=x_finalpos) {
x_leftspans=1
for (i=1;i<=imgslices-1;i+=2) {
var thisspan=eval("document.all.span"+i+".style")
thisspan.posLeft=x_finalpos
}
}
}
var timer=setTimeout("moveslices_IE()",pause)
}
else {
clearTimeout(timer)
}
}
// - End of JavaScript - -->
</SCRIPT>
将下列代码复制到<body></body>之间:
<body bgcolor="#FFFFFF" onload=initiate()>
<script>
<!-- Beginning of JavaScript -
for (i=0;i<=imgslices-1;i+=2) {
marginright=document.body.clientWidth+50
document.write("<span id='span"+i+"' style='position:absolute;visibility:visible; left:"+marginright+"px;top:"+y_finalpos+"px;clip:rect("+cliptop+"px "+clipright+"px "+clipbottom+"px "+clipleft+"px)'>")
document.write("<img src='"+imgurl+"'>")
document.write("</span>")
cliptop+=2*height_slice
clipbottom+=2*height_slice
}
cliptop=height_slice
clipbottom=2*height_slice
for (i=1;i<=imgslices-1;i+=2) {
marginleft=-imgwidth-50
document.write("<span id='span"+i+"' style='position:absolute;visibility:visible; left:"+marginleft+"px;top:"+y_finalpos+"px;clip:rect("+cliptop+"px "+clipright+"px "+clipbottom+"px "+clipleft+"px)'>")
document.write("<img src='"+imgurl+"'>")
document.write("</span>")
cliptop+=2*height_slice
clipbottom+=2*height_slice
}
// - End of JavaScript - -->
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -