ケータイ版 ミニタコ

  HTMLタグ > しゃぼん玉
画像がしゃぼん玉のようにふわふわ上がっていきます。

1) <body>〜</body>のどこかに以下のタグを入れます。
使う画像の数に合わせて以下の行を増減し、赤の番号も順番につけて下さい。

balloon[【番号】] = "【画像1】";

<scriot language=javascript1.2>
<!-- Original: Altan (snow@altan.hr) -->
<!-- Web Site: http://www.altan.hr/snow -->
<!-- Begin
var no = 15; // snow number
var speed = 1; // smaller number moves the snow faster
balloon = new Array();
balloon[0] = "【画像1】";
balloon[1] = "【画像2】";
balloon[2] = "【画像3】";
balloon[3] = "【画像4】";
balloon[4] = "【画像5】";
balloon[5] = "【画像6】";
var maxballoon = 【画像の数-1】;
var ns4up = (document.layers) ? 1 : 0; // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 300, doc_height = 600;
if (ns4up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight - 50;
} else if (ie4up) {
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight -50;
}
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
j = maxballoon;
for (i = 0; i < no; ++ i) {
dx[i] = 0; // set coordinate variables
xp[i] = Math.random()*(doc_width-50); // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*20; // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random(); // set step variables
if (ns4up) { // set layers
if (i == 0) {
document.write("
<img src=\"" + balloon[j] + "\" border=\"0\">
");
} else {
document.write("
<img src=\"" + balloon[j] + "\" border=\"0\">
");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 500px; LEFT: 15px;\">
<img src=\"" + balloon[j] + "\" border=\"0\">");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 500px; LEFT: 15px;\">
<img src=\"" + balloon[j] + "\" border=\"0\">");
}
}
if (j == 0) { j = maxballoon; } else { j -= 1; }
}
function snowNS() { // Netscape main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] -= sty[i];
if (yp[i] < 0) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = doc_height;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight -50;
}
dx[i] += stx[i];
document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowNS()", speed);
}
function snowIE() { // IE main animation function
for (i = 0; i < no; ++ i) { // iterate for every dot
yp[i] -= sty[i];
if (yp[i] < 0) {
xp[i] = Math.random()*(doc_width-am[i]-30);
yp[i] = doc_height;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
doc_width = document.body.clientWidth;
doc_height = document.body.clientHeight -50;
}
dx[i] += stx[i];
document.all["dot"+i].style.pixelTop = yp[i];
document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("snowIE()", speed);
}
if (ns4up) {
snowNS();
} else if (ie4up) {
snowIE();
}
// End -->
</script>


参考URL…http://www.altan.hr/snow/
「HTMLタグ」のトップに戻る
  サイト案内
  ご用達リンク
  QRコード


  カウンタ
Total:
Today:
Yesterday:

  通信販売
私がちまちま活動している同人サークル「タコの天ぷら」の発行物の紹介と通信販売です。


極楽浄土一番街 Vol.3


FF絵日記 Vol.8

その他、過去の発行物一覧は以下のリンクから。
タコの天ぷら[同人誌通販](チャレマ)