※新スキン専用です!
ユーザーがアップロードした画像にマウスをホバーさせると表示される、もっさりとした動きの『拡大する』というツールチップ。
リリース早々大不評のこの機能ですが、イベントリスナーが無名関数のため簡単にremoveEventListenerというわけにもいきません。
そこで、該当するimgエレメントを全て削除してから全く同じ中身のimgエレメントを同じ場所に置けばいいんじゃないか?というわけでスクリプトを書いてみました。
ピュアjavascriptでやろうとすると結構大変な作業なので、jqueryを導入してない方はしてください。
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
コードはこんな感じ。jQueryのおかげで超簡単です!
< script type="text/javascript" >
(function($){
$('.skinMainArea img[src*="user_images"]').each(function(){
var parent = $(this).wrap(
'<div class="imgParent" style = "display:none;"></div>'
).parent();
parent.get(0).imghtml = parent.html();
parent.html('');
});
$('.imgParent').each(function(){
this.imghtml && (
$(this).before(this.imghtml).remove()
);
});
}(jQuery));
</script>
これでイベントハンドラごと削除することができます。
鬱陶しく感じている方は是非とも試してみてください!
【追記】
旧スキンの場合は↓これでいけるかも?試してませんが・・・
< script type="text/javascript" >
(function($){
$('.entry .contents a.detailOn img[src*="user_images"],.subEntry .contents a.detailOn img[src*="user_images"]')
.each(function(){
var parent = $(this).wrap(
'<div class="imgParent" style = "display:none;"></div>'
).parent();
parent.get(0).imghtml = parent.html();
parent.html('');
});
$('.imgParent').each(function(){
this.imghtml && (
$(this).before(this.imghtml).remove()
);
});
}(jQuery));
</script>
【追記その2】
太字の部分のコード変更しました。
