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

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

1萌えてるんだろうか:2002/10/10(木) 23:28
┏━━┓
┃十十┃
┃日月┃  まぁ色々と。
┣━━┛


┃  ←スレ内容とはあまり関係ないですが十月十日にスレ立て記念

38萌えてるんだろうか:2002/10/19(土) 02:04
>37
自分がやったやり方を書いてみます。一応うまくいきました。
長いのでレス分けます。

スタイルシートのところに以下を追加。
<style type="text/css">
<!--
(この間)
-->
</style>
----------------------------------------------------------------------------------
.g_text {
left: expression(body.scrollLeft);
top: expression(body.scrollTop);
position: absolute;
filter: Alpha(opacity=60);
background: LightSlateGray;
}

a.gazou {
margin: 0 2 -2 2;
color: black;
background: darkgray;
cursor: hand;
}
img.bokashi {
width:100px;
height:75px;
}
img.bokashiabone {
width: backgroundPositionX;
height:backgroundPositionY;
}
img {
filter: Alpha(opacity=30);
backgroundPositionX: width;
backgroundPositionY: height;
}
-----------------------------------------------------------------------------------

39萌えてるんだろうか:2002/10/19(土) 02:08
同じようにJavaScriptのところに以下を追加。
<Script Language="JavaScript">
<!--
(この間)
//end-->
</script>
-----------------------------------------------------------------------------------
// ★THREADURL
var t_url=false,t_domain,t_bbs,t_key;
function threadurl() {
if( t_url==false ) {
for ( var i=0; i<document.all.tags("A").length; i++ ) {
var e=document.all.tags("A")(i);
if( e.innerText.match(/>|>[\d123456789]/) ) {
e.href.match(/http:\/\/(.*)\/test\/read.cgi\?bbs=(.*)\&key=(.*)\&st/);
t_url=true;
t_domain=RegExp.$1;
t_bbs=RegExp.$2;
t_key=RegExp.$3;
break;
}
}
}
return t_url;
}

40萌えてるんだろうか:2002/10/19(土) 02:09
// ★SETTING.TXT表示
function printsetting() {
if( threadurl() ) {
window.open( "http:\/\/"+t_domain+"\/"+t_bbs+"\/SETTING.TXT", "_blank" );
}
}

// ★マウスジェスチャー用変数
var G_MARGIN=19; // マージン
var mouseX;
var mouseY;
var isMouseMove=false; // ジェスチャー最中フラグ
var tempGesture=""; // 一つ前のジェスチャー
var mouseGesture=""; // ジェスチャー
var isMenuEnable=false; // 右クリメニュー許可フラグ
var tid;

// ★マウスジェスチャー開始
function downMouse()
{
g_text.innerText="";
if( event.button & 2 ) {
isMouseMove=true;
mouseGesture="";
tempGesture=""
mouseX=event.clientX;
mouseY=event.clientY;
clearTimeout(tid);
}
else
{
isMouseMove=false;
}
}

41萌えてるんだろうか:2002/10/19(土) 02:09
// ★マウスジェスチャー解析
function moveMouse()
{
if(!isMouseMove) {
return;
}

if( (event.button & 2) == 0 )
{
isMouseMove=false;
tempGesture="";
mouseGesture="";
isMenuEnable=false;
g_text.innerText="";
return;
}

var gesture="";
if(mouseX-event.clientX > G_MARGIN) gesture="←";
if(event.clientX-mouseX > G_MARGIN) gesture="→";
if(mouseY-event.clientY > G_MARGIN) gesture="↑";
if(event.clientY-mouseY > G_MARGIN) gesture="↓";
if( gesture=="" )return;
mouseX=event.clientX;
mouseY=event.clientY;
if( tempGesture==gesture ) return;
tempGesture=gesture;
mouseGesture+=gesture;
g_text.innerText=mouseGesture;
}

// ★マウスジェスチャーでいろいろ起動
function upMouse()
{
if( isMouseMove==false || mouseGesture=="") {
isMenuEnable=true;
return;
}
isMenuEnable=false;
isMouseMove=false;
tid=setTimeout('g_text.innerText=""',1000);

if( mouseGesture=="↑" ) {
// ■一番上へスクロール
g_text.innerText="一番上へ";
scroll(0,0);
}
if( mouseGesture=="↓" ) {
// ■一番下へスクロール
g_text.innerText="一番下へ";
scroll(0,document.body.scrollHeight);
}
if( mouseGesture=="←" ) {
// ■半画面上へスクロール
g_text.innerText="半画面上へ";
scrollBy(0,-document.body.offsetHeight/2);
}
if( mouseGesture=="→" ) {
// ■半画面下へスクロール
g_text.innerText="半画面下へ";
scrollBy(0, document.body.offsetHeight/2);
}
if( mouseGesture=="↑→↓←" ) {
// ■設定表示
g_text.innerText="設定表示";
printsetting();
}
if( mouseGesture=="→←" ) {
// ■新着レスへスクロール
if(document.all.item("new")) {
g_text.innerText="新着レスへ";
document.all.item("new",0).scrollIntoView(true);
}
else {
g_text.innerText="新着レスはありません";
}
}
}

// ★マウスジェスチャー成功時は右メニューキャンセル
function cancelMenu()
{
return isMenuEnable;
}

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;
}
}

43萌えてるんだろうか:2002/10/19(土) 02:10
// ★リンクの確認
function checkAnchor() {
var e = window.event.srcElement;
var phre = new RegExp('^http:\\/\\/', 'i');
// 長いポップアップを短く
if (e.tagName == 'A') {
if(e.href.match(/^http:\/\/.*nofirst=true$/)) {
e.href.match(/&st=(\d+)&to=(\d+)/);
resst=(RegExp.$1);
resto=(RegExp.$2);
if(resto-resst >19 ) {
e.href.match(/&to=(\d+)/);
e.href = RegExp.leftContext + "&to=" + (resst-0+19) + RegExp.rightContext;
}
}
// 画像ボタン貼り付け
if ((imageExt(e.href)) && (e.href.search(phre) == 0) && (e.id.search(/^Replaced/) == -1)) {
insButton(e);
}
}
}

function imgOver(my,num) {
if(my.className == 'bokashi') {
my.style.filter="Alpha(opacity="+num+")";
}
}

document.onmouseover = checkAnchor;
document.oncontextmenu = cancelMenu;
document.onmousedown = downMouse;
document.onmousemove = moveMouse;
document.onmouseup = upMouse;
----------------------------------------------------------------------------------

そして<body>タグの直下に
<div id="g_text" class="g_text"></div><dl>
を追加。

44萌えてるんだろうか:2002/10/19(土) 02:16
うわ、異様に長くなってしまった!
要するに、gesture.txt の中身(スタイルシートとJS)を今まで使ってたスキンに移植すれば
ちゃんと動くと思います。
一番忘れやすいのが
<div id="g_text" class="g_text"></div><dl>
かな。
便利なので37さんもがんがれーヽ(´ー`)ノ


新着レスの表示


名前: E-mail(省略可)

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

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

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

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