Auto ThickBox Plus

Auto ThickBox Plus プラグイン

※ 上の画像をクリックすると ThickBox のポップアップ動作が一目で分かります。

目次

概要

Auto ThickBox Plus プラグインは Auto Thickbox プラグインをベースに様々な機能追加やバグ修正を施した改良版。

リンクをクリックすると、リンク先のコンテンツがページ上にシンプルかつ軽快な効果でポップアップ表示される。サムネイル画像をオリジナルサイズで手軽にポップアップ表示したい場合におすすめ。

基本機能

  • ThickBox スクリプトがサムネイル画像 (WordPress ギャラリー含む) に自動的に適用される
    • WordPress ギャラリーに画像をアップロードするか画像リンクを伴う画像 (<a href="image"><img /></a>) を記述するだけで OK
  • Lightbox, ColorBox, FancyBox, Shadowbox, Slimbox などと比較するとポップアップ効果がシンプルで動作が軽快
    • ThickBox はアニメーション効果や装飾的なデザインを好まない人に最適
  • ブラウザーウィンドウより大きな画像は自動的にリサイズされる
  • WordPress 標準搭載の ThickBox ライブラリを使用 (スクリプトのインストールや参照が不要)

追加機能

  • ポップアップ画像をスライド表示 (Gallery Images) または個別表示 (Single Image) スタイルで表示
  • 画像リンクを伴うテキスト (<a href="image">text</a>) にも自動的に ThickBox を適用
  • 画像の自動リサイズ機能を無効にすることもできる
  • ThickBox ウィンドウをマウスドラッグによって移動/リサイズできる
  • プラグインの挙動やデザインを 50 以上のオプションによってカスタマイズできる
  • BMP, WebP 画像形式をサポート
  • ページ上のインラインコンテンツをサポート (#TB_inline)
  • AJAX コンテンツをサポート (同じドメイン上のファイルを iframe を使わずにページ上に表示)
  • 旧バージョンの WordPress 2.7 までの幅広い互換性
  • WordPress 3.2/3.3 のデフォルトテーマ (Twenty Eleven) との互換性
  • W3 Total CacheHead Cleaner などのキャッシュプラグインとの互換性
  • 改良版 ThickBox は NextGEN Gallery などのほかの ThickBox プラグインでも有効
  • WordPress の翻訳を使用
    • ThickBox ウィンドウは 70 以上の言語にローカライズされる (アラビア語、中国語、オランダ語、フランス語、ドイツ語、ヒンディー語、イタリア語、日本語、韓国語、ポーランド語、ポルトガル語、ロシア語、スペイン語など)
  • オリジナルのプラグインや thickbox.js/css にある多数のバグを修正 (更新履歴参照)

ダウンロード

バージョン
1.4 (2012-03-29)
作成者
attosoft
ライセンス
GPL 2.0 (日本語参考訳)
必須バージョン
WordPress 2.7 以上
対応する最新バージョン
WordPress 3.3.1

更新履歴

インストール

自動インストール

  1. WordPress のダッシュボードにアクセスする
  2. [プラグイン] – [新規追加] を選択
  3. テキストフィールドに "thickbox" と入力して [プラグインの検索] をクリック
  4. 「Auto ThickBox Plus」の「今すぐインストール」をクリック
  5. 「プラグインを有効化」をクリック
  6. WordPress ギャラリーに画像をアップロード、または画像やほかのページへのリンクを記述する

手動インストール

  1. auto-thickbox-plus.zip をダウンロードする
  2. WordPress のダッシュボードにアクセスする
  3. [プラグイン] – [新規追加] – 「アップロード」タブを選択
  4. ダウンロードした ZIP ファイルをアップロードして [今すぐインストール] をクリック
  5. 「プラグインを有効化」をクリック
  6. WordPress ギャラリーに画像をアップロード、または画像やほかのページへのリンクを記述する

手動インストール (FTP)

  1. auto-thickbox-plus.zip をダウンロードして解凍する
  2. 生成されたプラグインフォルダーを wp-content/plugins/ ディレクトリーにアップロードする
  3. WordPress の [プラグイン] メニューからプラグインを有効化する
  4. WordPress ギャラリーに画像をアップロード、または画像やほかのページへのリンクを記述する

※ 注:オリジナルの Auto Thickbox プラグインがインストールされている場合は、Auto ThickBox Plus プラグインを有効化する前に停止またはアンインストールしておく。Auto ThickBox Plus プラグインとオリジナルのプラグインを同時に有効化することはできない。

デモ

個別表示 (Single Image)

Image1 - 葉の世界地図 Image2 - 青い惑星と緑の葉 Image3 - この星をきれいに Image4 - 透明な地球

スライド表示 (Gallery Images)

Image1 - 葉の世界地図 Image2 - 青い惑星と緑の葉 Image3 - この星をきれいに Image4 - 透明な地球

ポップアップ表示無効 (No ThickBox)

Image1 - 葉の世界地図 Image2 - 青い惑星と緑の葉 Image3 - この星をきれいに Image4 - 透明な地球

画像へのテキストリンク

個別表示
Image1, Image2, Image3, Image4
スライド表示
Image1, Image2, Image3, Image4
ポップアップ表示無効
Image1, Image2, Image3, Image4

使い方

Usage (英語) は最新バージョンに追従していますが、日本語の説明は多少古くなってます。

Single Image (個別表示)

画像ファイルへの画像リンクを記述すると、リンク先の画像が現在表示されているページ上にポップアップ表示される。

<a href="image.png">
    <img src="image_s.png" alt="Sample Image" />
</a>

また画像ファイルへのテキストリンクを記述すると、同様にリンク先の画像がポップアップ表示される。

<a href="image.png" title="Sample Image">Link Text</a>

※ img 要素の alt 属性に記述していた画像の説明は、代わりに a 要素の title 属性で指定する。

Gallery Images (スライド表示)

画像をスライド表示 (Gallery Images) スタイルで表示したい場合は、a 要素の rel 属性に共通の値を指定する。(a@rel="foo")

<a href="image1.png" rel="foo">
    <img src="image1_s.png" alt="Image1" />
</a>
<a href="image2.png" rel="foo">
    <img src="image2_s.png" alt="Image2" />
</a>

ポップアップ表示無効

画像のポップアップ表示を無効にしたい場合は、a 要素の class 属性に "nothickbox" を指定する。(a@class="nothickbox")

<a href="image.png" class="nothickbox">
    <img src="image_s.png" alt="Sample Image" />
</a>

画像以外へのリンクの ThickBox 適用

画像以外へのリンク (iframe など) に ThickBox を適用したい場合は、a 要素の class 属性に "thickbox" を指定する。(a@class="thickbox")

<a href="iframe.html" class="thickbox" title="Sample Page">
    Any links to non-image
</a>

FAQ

FAQ (英語) は最新バージョンに追従していますが、日本語の説明は多少古くなってます。

Auto ThickBox Plus の設定ページにアクセスするには?

  1. WordPress のダッシュボードにアクセスする
  2. サイドバーの [設定] – [Auto ThickBox Plus] をクリック

Auto ThickBox Plus 設定ページ

デフォルトではスライド表示スタイルで画像をポップアップ表示したい

  1. [Auto ThickBox Plus 設定] ページを開く
  2. [デフォルト表示スタイル] – [スライド表示] を選択
  3. [変更を保存] ボタンをクリック

デフォルトではリンクテキストに ThickBox を適用したくない

  1. [Auto ThickBox Plus 設定] ページを開く
  2. [テキストリンクへの ThickBox 適用] – [手動] を選択
  3. [変更を保存] ボタンをクリック

オリジナルの ThickBox リソース (JS, CSS) を使いたい

  1. [Auto ThickBox Plus 設定] ページを開く
  2. [ThickBox リソース (JS, CSS)] – [最適化 (圧縮&微調整) された代替リソースを読み込む (thickbox.js, thickbox.css)] のチェックをはずす
  3. [変更を保存] ボタンをクリック

サポートする?

  • プラグインをインストールしてみたよ、という人は WordPress.org のページから評価スターや互換性情報 (Works/Broken) をいただけると嬉しいです
  • フィードバックや質問があるよ、という人はプラグインフォーラムコンタクトページをお使いください
  • ほかの言語に翻訳できるよ、という人はローカライズ方法を説明しますので連絡ください (おかしな英語があるよ、という場合も連絡ください)
  • このプラグインを気に入ったよ、という人向けに応援するページを作ってみました

いただいたコメントは大変参考になります。ここまで読んでいただきありがとうございました。

スペシャルサンクス

関連記事

  1. WordPress: 画像をポップアップ表示する Auto ThickBox Single プラグイン (Auto Thickbox Plus プラグインへ更新されました)
  2. Auto Thickbox Plus プラグイン version 0.3 公開
  3. Auto Thickbox Plus プラグイン version 0.1 公開
  4. Auto Thickbox Plus プラグイン 0.4 公開
  5. Auto Thickbox Plus プラグイン 0.5 公開

コメント

  1. [...] Auto Thickbox Plus Plugin Official Site [Japanese] [...]

  2. Sippu より:

    "Auto Thickbox Plus"利用させていただきました。
    いろいろあって悩んだのですがテキストリンク対応が便利そうだったのでこれを選びました。
    ありがとう。

    • attosoft より:

      コメントありがとうございます。
      ほかのポップアップ系のプラグインと比べると多機能ではありませんが、シンプルに使うには十分便利な機能が小さくまとまっていると思います。

  3. Jhorman より:

    Can I customize width and height ?

    • attosoft より:

      ThickBox script will calculate the size of popup window based on image size.
      So if you want to customize image size, I think you need to modify thickbox.js.

      If you want to resize image size to half, for example, write the following code at about line 133 in thickbox.js (thickbox_uncompressed.js).

      imageWidth = imageWidth / 2;
      imageHeight = imageHeight / 2;
      
  4. [...] WordPress: シンプルな効果で画像をポップアップ表示する Auto ThickBox Plus プラグイン | attosoft.info Blog [...]

  5. murat より:

    Can I iframe customize width and height ?

  6. [...] you like this plugin, please consider making a donation to support plugin [...]

  7. Guan Gui より:

    Hey,

    It seems the following bug still persists in jQuery 1.7.1. From your code thickbox.js line 896-902:

    // XXX: On display:none, width/innerWidth/outerWidth() returns 0, outerWidth(true) returns only margin in v1.4.4 or earlier
    // XXX: On display:none, innerWidth/outerWidth() returns width(), outerWidth(true) returns only margin in v1.6.2 or earlier
    if (jQuery("#TB_window").css("display") == "none" &&
    	(tb_versionCompare('1.4.4') > 0 || (tb_versionCompare('1.6.2') > 0 && include)))
    	jQuery.swap(jQuery("#TB_window")[0], {position: "absolute", visibility: "hidden", display: "block"}, setter);
    else
    	setter();
    

    Have to make it satisfy the first condition in order to make your plugin work.

    Please have a look. Thanks!

    -Guan

    • attosoft より:

      Hi Guan, Thanks for your comment.

      Generally it is no need to call jQuery.swap() in getting width/height. But jQuery has width/height bugs in v1.4.3 (or earlier) and v1.6.1 (or earlier). So the code above calls jQuery.swap() for a workaround. For details, see release notes below.

      I checked your site. Your site loads jQuery v1.4.2 and v1.7.1. I'm not sure for now but I think this is the cause.

  8. kami より:

    Hello ^^
    can u change the border color of the pictures?
    Coz i have been look but i cannot find the setting od this? :/

    photo
    http://i304.photobucket.com/albums/nn179/princessgirlbunny/Captura-de-pantalla-2012-05-18-a-las-0912.jpg

    • attosoft より:

      Hi kami,

      You can customize image/window borders by using Border option. Border option syntax is "border-width border-style border-color". So #666 and #ccc is border-color. For details, see border description in MDN (Spanish).

    • kami より:

      I am sorry for my ignorance, i dont understand this ^^;
      I have to check that in my theme layout or in ur plugin where says EDIT and i can see the php and CSS ??.
      Thank u :)

    • attosoft より:

      Sorry for my bad English. You can change the border color through Options page.

      1. Access Dashboard screen in WordPress
      2. Click [Settings] – [Auto ThickBox Plus] in sidebar
      3. Replace "#666"/"#ccc" with "#CFCFCF" in [View] – [Border] – [Image (Top left/Bottom right)] option
    • kami より:

      So sorry, i though was from ur plugin thats why i asked to you, i found the reply, i had to go to my worpress/content – media php…
      thank u so much for ur time anyway :)

    • attosoft より:

      media.php!? Oh I understand what you say finally. I'm talking about Auto ThickBox Plugin but you are talking about just WordPress Gallery. You seem to try to change the border color of thumbnails in WordPress Gallery. So you need to overwrite the following CSS rule written in media.php.

      #gallery-1 img {
          border: 2px solid #CFCFCF;
      }