したらばTOP ■掲示板に戻る■ 全部 1-100 最新50 | |

PC周辺とかソフトウェアとか@hey!板

42萌えてるんだろうか:2002/10/19(土) 02:09
// ★画像サムネイル
imgNo = 0;
// 画像ボタン挿入
function insButton(a) {
if (a.id != 'replaced') {
var imgurl = a.href;
var nHTML = '<a class="gazou" onclick=insImage("' + imgurl + '") id="buttonID' + imgNo.toString() +'">Open</a>';
imgNo++;
a.insertAdjacentHTML('AfterEnd',nHTML);
a.id = 'replaced';
}
}
// 画像が404
function imgNotFoound(imgid, imgbtnid) {
var ie = document.getElementById(imgid);
if (ie) {
ie.style.display = 'none';
if (ie.sourceIndex > 0) {
eBR = document.all[ie.sourceIndex - 1];
if ((eBR) && (eBR.tagName == 'BR')) {
eBR.style.display = 'none';
}
}
}
var ibe = document.getElementById(imgbtnid);
ibe.innerText = '404';
ibe.style.color="red";
ibe.onclick = 'return(false)';
}
// 画像ボタンクリック
function insImage(isu) {
var e = window.event.srcElement;
var eBR = '';
var eid = e.id.replace(/^buttonID/,'');
if (imageExt(isu)) {
var ie = document.getElementById('imgID' + eid);
var imgclass = 'bokashi';
if (ie) {
if (ie.style.display == 'none') {
ie.style.display = 'inline';
ie.className = imgclass;
if (ie.sourceIndex > 0) {
eBR = document.all[ie.sourceIndex - 1];
if ((eBR) && (eBR.tagName == 'BR')) {
eBR.style.display = 'inline';
}
}
e.innerText = 'Hide';
} else {
var j = document.images.length;
for (var i = 0; i < j; i++ ) {
ie = document.images[i];
if ((ie) && (ie.id.search(/^imgID/) == 0) && (isu.toLowerCase() == ie.src.toLowerCase()) && (ie.style.display != 'none')) {
ie.style.display = 'none';
if (ie.sourceIndex > 0) {
eBR = document.all[ie.sourceIndex - 1];
if ((eBR) && (eBR.tagName == 'BR')) {
eBR.style.display = 'none';
}
}
}
}
e.innerText = 'View';
}
} else {
var nHTML = '<br><img src="' + isu + '" id="imgID' + eid + '" class="' + imgclass + '" onError="imgNotFoound(\'imgID' + eid + '\',\'' + e.id + '\');" onClick="hideImage();" onmouseover="imgOver(this,100);" onmouseout="imgOver(this,30)">';
if (e.sourceIndex < document.all.length-1) {
eBR = document.all[e.sourceIndex + 1];
if (!((eBR) && (eBR.tagName == 'BR'))) {
nHTML += '<br>';
}
}
e.innerText = 'Hide';
e.insertAdjacentHTML('afterEnd',nHTML);
}
}
return false;
}
// 画像クリックで拡大縮小
function hideImage() {
var e = window.event.srcElement;
if (e.id.search(/^imgID/) == -1) return;
var iu = e.src;
var eBR = '';
var j = document.images.length;
for (var i = 0; i < j; i++ ) {
e = document.images[i];
if ((e) && (e.id.search(/^imgID/) == 0) && (iu.toLowerCase() == e.src.toLowerCase()) && (e.style.display != 'none')) {
if (e.className == 'bokashi') {
e.className = 'bokashiabone';
} else {
e.className = 'bokashi';
}
}
}
}

// ★IMGタグ挿入対象拡張子
function imageExt(isu) {
if (isu.search(/\.png$|\.jp(g|e|eg)$|\.gif$|\.bmp$/i) != -1) {
return true;
} else {
return false;
}
}


新着レスの表示


名前: E-mail(省略可)

※書き込む際の注意事項はこちら

※画像アップローダーはこちら

(画像を表示できるのは「画像リンクのサムネイル表示」がオンの掲示板に限ります)

掲示板管理者へ連絡 無料レンタル掲示板