• ベストアンサー
※ ChatGPTを利用し、要約された質問です(原文:data-hrefでのcolorbox設定方法)

data-hrefでのcolorbox設定方法

このQ&Aのポイント
  • data-hrefでのcolorbox設定方法について教えてください。
  • テーブル行をリンクできるように設定しているjQueryのセットアップ方法を教えてください。
  • Colorboxを使用してリストの各行をクリックした際に、Inlineフレームを表示する方法を教えてください。

質問者が選んだベストアンサー

  • ベストアンサー
  • fujillin
  • ベストアンサー率61% (1594/2576)
回答No.1

colorboxはよく知りませんが、表示先のurlを指定できるようになっているみたいなので、それを利用すればいいんでは? http://www.jacklmoore.com/colorbox/ iframe: true, href: XXX ~~ とか (iframeのurlがどうなっているのか、ご質問文では不明なので・・・) ご提示のスクリプトの前半のものは何をしたいのかよくわかりませんでした。

watermusic333
質問者

お礼

ご回答ありがとうございました。 説明不足で申し訳ありません。 前半のスクリプトは下記サイトを参考にテーブルの列(tr)全体をリンク先に指定する、というものです。 http://kachibito.net/web-design/clickable-table-rows.html ご指摘頂いた点、colorboxの設定自体にurl指定する事でうまく動きました。 colorboxのオプションという初歩的な確認をしておらず、お恥ずかしいです。 こちらを踏まえて下記のように修正した所、うまく動作しました! =================================== $(function() { $('.list tr[data-href]').addClass('clickable') .click(function(e) { if(!$(e.target).is('a')){ window.location = $(e.target).closest('tr').data('href');} }); $(".list tr.inline").colorbox({inline:true, innerWidth:"350px", href:"#inline_content"}); }); =================================== 本当にありがとうございました!

全文を見る
すると、全ての回答が全文表示されます。

関連するQ&A

  • table内の画像を中央寄せ、のせると拡大、方法?

    画像にマウスポインタをのせると画像が拡大される機能を備えた 画像の表を作りたいです。 テーブルの各セルに入る画像の配置を縦横両方中央揃えにしたいです。 CSSのマージンで調整しましたが、セルによって微妙に配置がずれてしまいました。 あと、画像は拡大されるのですが、拡大されていない画像が前面に出てきてしまいます。 各セルの画像の縦横中央揃え、画像が正しく拡大される方法を教えて下さい。 下記は自分が入力したHTMLとCSSです。それをFirefoxで表示したものを添付しました。 アドバイスをお願いいたします。 ~~~ HTML ~~~ <link rel="stylesheet"type="text/css" href="a.css"> <table border="1" width="500" cellpadding="5" bordercolor="#333333" /> <tr> <th bgcolor="#FFA07A">あいう <th bgcolor="#FFA07A">えおか <th bgcolor="#FFA07A">きくけ </tr> <tr> <td><a class="thumbnail" href="画像.jpg"><img src="画像.jpg" width="130" height="170" alt="" /></a></td> <td><a class="thumbnail" href="画像.jpg"><img src="画像.jpg" width="130" height="170" alt="" /></a></td> <td><a class="thumbnail" href="画像.jpg"><img src="画像.jpg" width="130" height="170" alt="" /></a></td> </tr> <tr> <td align="left">ああああああああああああああああ</td> <td align="left">いいいいいいいいいいいいいいい</td> <td align="left">うううううううううううううううう</td> </tr> </table> <br> <br> <table border="1" width="500" cellpadding="5" bordercolor="#333333" /> <tr> <th bgcolor="#FFA07A">こさし <th bgcolor="#FFA07A">すせそ <th bgcolor="#FFA07A">なにぬ </tr> <tr> <td><a class="thumbnail" href="画像.jpg"><img src="画像.jpg" width="130" height="170" alt="" /></a></td> <td><a class="thumbnail" href="画像.jpg"><img src="画像.jpg" width="130" height="170" alt="" /></a></td> <td><a class="thumbnail" href="画像.jpg"><img src="画像.jpg" width="130" height="170" alt="" /></a></td> </tr> <tr> <td align="left">ええええええええええええええええええええええ</td> <td align="left">おおおおおおおおおおおおおおおおおおおお</td> <td align="left">かかかかかかかかかかかかかかかかかか</td> </tr> </table> ~~~ CSS ~~~ a.thumbnail { display: block; float: left; } a.thumbnail img{ position: relative; } a.thumbnail, a.thumbnail img{ width: 130px; height: 170px; margin: 0px 0px 0px 5px; } a.thumbnail:hover { border: none; cursor: default; } a.thumbnail:hover img { width: auto; height: auto; }

    • ベストアンサー
    • HTML
  • テーブル内に隙間が。

    テーブル内に隙間が。 質問です。CSSとテーブルタグを使用してwebページを作りました。が、 IE,FireFox,Chrome等のブラウザでは添付画像のように隙間が出来ます。 これを無くすにはどうすればいいのでしょうか。 (html/cssの書き直さなくてはならない箇所はどこでしょうか) 高さは左右のセルとも300に合わせているのですが…。 どなたかご教授願います。 <!--ソース --> <style TYPE="text/css"> <!-- td { margin: 0; padding: 0px; } .content_title { display: block; position: relative; padding-left: 0px; width: 100%; height: 40px; color: #ffffff; background-color: #000000;} .content_cell { position: relative; padding-bottom: 0px; width: 100%; height: 260px; padding: 0; } .menu_link { display: block; position: relative; width: 100%; height: 30px; padding-top: 12px; text-align: center; font-size: 11pt; color: #f5f5f5; background-color: #000000; } --> </style> <table bordercolor="#aaaaaa" border="2" align="center" width="92%" bgcolor="#353535" cellspacing="2" height="300"> <td rowspan="6" width="72%" bgcolor="#ffffff" height="300" valign="top"> <div class="content_title">あいうえお</div> <div class="content_cell"><img src="img/hikaku.png" width="100%" height="100%" border="0"></div> </td> <td width="28%" height="30" align="center" bgcolor="#000000"> <a class="menu_link" href="../about/index.html">cell_1</a> </td> <tr><td width="28%" height="30" align="center" bgcolor="#000000"> <a class="menu_link" href="../flash/index.html">cell_2</a> </td></tr> <tr><td width="28%" height="30" align="center" bgcolor="#000000"> <a class="menu_link" href="../web/index.html">cell3</a> </td></tr> <tr><td width="28%" height="30" align="center" bgcolor="#000000"> <a class="menu_link" href="../diy/index.html">cell_4</a> </td></tr> <tr><td width="28%" height="30" align="center" bgcolor="#000000"> <a class="menu_link" href="../link/index.html">cell_5</a> </td></tr> <tr><td width="28%" align="center" height="150" bgcolor="#000000"> <!-- no contents -->no content </td></tr> </table>

  • colorbox 画像が表示されない

    質問おねがい致します。 本業は紙媒体で 並行して独学でwebを学んでおりますがJqueryのcolorboxが表示されずに いきづまっています。パスが違うとか素人の失敗だとはおもうんですが ドリームウィーヴァーで作成しているのですが テンプレートファイルを作成し 追加ページで画像にリンクをはり <div class="box"><a href="/images/mapBig.png" rel="example1" title="map"><img src="/images/mapSmall.png" width="245" height="147" alt="map" /></a></div> としているのですが ライブビューではちゃんとポップアップになるのですが ブラウザーでプレビューしたりサーバーアップして確認すると オーバーレイの黒い背景と白い棒が2本でてきて画像自体が表示されません 下記はテンプレートのソースです。 ジャバの部分はcolorboxからペーストです colorbox.cssの画像へのパスは url(images/controls.png) に統一しています どなたかお願いします!! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Style-Type" content="text/javascript" /> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW"> <!-- TemplateBeginEditable name="doctitle" --> <title>00000000000000000000</title> <!-- TemplateEndEditable --> <meta name="description" content="0000000000000000000000000" /> <meta name="keywords" content="00000000000000000000000000000" /> <link href="../css/screen.css" rel="stylesheet" type="text/css" media="screen" /> <link href="../js/colorbox/example1/colorbox.css" rel="stylesheet" type="text/css" media="screen" /> <script type="text/javascript" src="../js/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="../js/colorbox/colorbox/jquery.colorbox.js"></script> <script type="text/javascript"> $(document).ready(function(){ //Examples of how to assign the ColorBox event to elements $("a[rel='example1']").colorbox(); $("a[rel='example2']").colorbox({transition:"fade"}); $("a[rel='example3']").colorbox({transition:"none", width:"75%", height:"75%"}); $("a[rel='example4']").colorbox({slideshow:true}); $(".example5").colorbox(); $(".example6").colorbox({iframe:true, innerWidth:425, innerHeight:344}); $(".example7").colorbox({width:"80%", height:"80%", iframe:true}); $(".example8").colorbox({width:"50%", inline:true, href:"#inline_example1"}); $(".example9").colorbox({ onOpen:function(){ alert('onOpen: colorbox is about to open'); }, onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); }, onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); }, onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); }, onClosed:function(){ alert('onClosed: colorbox has completely closed'); } }); //Example of preserving a JavaScript event for inline calls. $("#click").click(function(){ $('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here."); return false; }); }); </script> <!-- TemplateBeginEditable name="head" --> <!-- TemplateEndEditable --> </head>

  • CSSでスクロールボックス

    div要素を使ってスクロールボックスのようなものを作っているのですが、その中にa:hoverを使ったリンクがあり、このリンクにマウスカーソルを持ってくると、スクロールボックス自体が下の方に移動してしまいます。 Internet Explorerでだけこの現象が発生します。FirefoxやOperaでは問題ありません。 何か解決方法はないでしょうか。 一応以下にソースを載せます。縦方向のスクロールする行が多いほど、移動する量も大きくなります。 --- css --- div.test { width: 90%; height: 100px; border: 1px solid #003333; overflow: scroll; } a.test:link, a.test:visited { color: #000000; text-decoration: underline; } a.test:hover { color: #ffffff; background-color: #999999; text-decoration: none; } --- End --- --- html --- <div class="test"> <table class="test" align="center"> <tr> <th width="100px"><a class="test" href="test.html">Col1</a></th> <th width="100px"><a class="test" href="test.html">Col2</a></th> <th width="100px"><a class="test" href="test.html">Col3</a></th> <tr> <td nowrap>data1</td> <td nowrap>data2</td> <td nowrap>data3</td> </tr> 以下、同じようにあと10行程度追加 </table> </div>

    • ベストアンサー
    • CSS
  • css テーブルについて

    よろしくお願いします。 2だけを300pxと100pxに2分割にできないでしょうか。 <div class="aa"> <table> <tr> <th>1</th> <td>2</td> </tr> <tr> <th>1</th> <td>1</td> </tr> </table> </div> .aa table { width: 500px; height: 100px; border: 1px #000000 solid; border-collapse: collapse; } .aa th { width: 100px; border: 1px #000000 solid; } .aa td { width: 400px; border: 1px #000000 solid; }

    • ベストアンサー
    • CSS
  • ビルダーで問い合わせフォームの設定

    会社でホームペジ制作中ですが、問い合わせフォーム(ビルダー既存の物)と雇用の履歴書フォームを作り メールで、送信させたいのですが、送信ボタンに此方のアドレスをリンク設定するだけかと 思ってましたが・・・・全然だめです。 しかし本屋その他の質問やメーユフォームなど検索しましたが、 私の頭では、理解できませんでした。 HTMLなどをどのように変更するのか・・・ビルダーの部品を使う場合・・・また 他におすすめのレンタルやフリーの物がありますか、 もう 考えすぎて・・・頭や目がヒクヒク(笑) 簡単なものがよいのですが・・・ 計画では住所をプルダウンさせたり、チエックボタンつけたりしたかったのですが・・・ 初心者なので、 サルでもわかる説明お願いします。 現在OCNを使ってます。 <form method="get" action=""> <h3>お問い合わせフォーム (電話、FAX,でも合せて受け付けております。)</h3> <p>業務内容についてのお問い合わせは、下記にて承っております。</p> <p>*は必須項目です。</p> <table width="548" height="332"> <tbody> <tr> <th width="145" height="25">お問い合わせ内容*</th> <td height="25"><textarea name="message" class="l" cols="40" rows="12"></textarea></td> </tr> <tr> <th width="145">会社名*</th> <td><input type="text" name="name" class="m"></td> </tr> <tr> <th width="145">ご担当者(フリカナ)*</th> <td><input type="text" name="name" class="m"></td> </tr> <tr> <th width="145">御担当者名(漢字)*</th> <td><input type="text" name="kana" class="m"></td> </tr> <tr> <th width="145">E-Mail*</th> <td><input type="text" name="email" class="l"></td> </tr> <tr> <th width="145">電話番号(半角)*</th> <td><input type="text" name="tel" class="l"></td> </tr> <tr> <th width="145">FAX番号(半角)</th> <td><input type="text" name="fax" class="l"></td> </tr> </tbody> </table> <a href="mailto:私のアドレス.ocn.ne.jp?Subject=BIG1%20%96%E2%82%A2%8D%87%82%ED%82%B9"><input type="submit" value="  送信  " class="button"></a></form>

  • テーブルの料金表の複雑な記述方法

    練習でメニュー表作成をしているのですが、ややこしくてわかりません。。 やりたいことは、サービス内容と料金、ストレート、パーマ、トリートメントの色を同じに変更したいです。 ストレート、パーマ、トリートメントのところは右サイドの大人のところも料金も含めて色を変更したいです。 値段のところにclassを設定したから、縦には全部色を変えれるのですが、横にとなるとわかりません。 どのように記述すればよいでしょうか? <table width="558" style="position: relative; top: -506px; left: 240px;"> <thead> <tr> <th rowspan="2" colspan="2"> サービス内容 </th> <th width="99" height="29" colspan="3"> 料金 </th> </tr> </thead> <tbody> <tr> </tr> <tr> <th width="165" rowspan="3"> カット </th> <td class="white" width="270"> 大人(一般) </td> <td class="price"> \4,200 </td> </tr> <tr> <td class="white"> 中学・高校生 </td> <td class="price"> \3,000 </td> </tr> <tr> <td class="white"> 小学生以下 </td> <td class="price"> \2,500 </td> </tr> <tr> <th> ストレート </th> <td class="white"> 縮毛矯正(カット・ブロー込) </td> <td class="price"> \8,600 </td> </tr> <tr> <th> パーマ </th> <td class="white"> カット・ブロー込 </td> <td class="price"> \5,200 </td> </tr> <tr> <th> カラー </th> <td class="white"> ファッションカラー </td> <td class="price"> \4,500 </td> </tr> <tr> <th rowspan="2"> トリートメント </th> <td class="white"> スペシャルプラチナ </td> <td class="price"> \2,300 </td> </tr> <tr> <td class="white"> スペシャルイオン </td> <td class="price"> \4,100 </td> </tr> </tbody> </table>

  • ブラウザによってテーブルのセルの高さが変わる

    質問させて頂きます。 現在、テーブルを使用して表を作っているのですが、 ブラウザによってセルの高さが変わってしまいます。 safariでは思った通りのレイアウトになるのですが、 chrome、Firefoxでは [ height ] の値が反映されていないのか、 崩れてしまいます。 添付は希望するレイアウト(safariではこのように表示されます)です。 ソースを記載しますので、どなたかご教示お願い致します。 --- html --- <table class="hogs" cellspacing="5"> <tr> <td width="180" height="184" rowspan="3"><img src="img/001.gif" width="180" height="184" alt=""/></td> <th height="22">項目1</th> <td>文章1</td> </tr> <tr> <th height="22">項目2</th><td height="22">文章2</td> </tr> <tr> <th height="140" valign="top">項目3</th><td valign="top">文章3</td> </tr> </table> --- CSS --- table.hoge { background-color: rgba(50,50,50,0.3); width: 640px; height: 184px; margin: 0 auto 18px; padding: 10px; } table.hoge th { height: 22px; background-color: #7ac0c9; width: 80px; } table.hoge td { padding: 0 20px; }

    • ベストアンサー
    • HTML
  • 文字列が入っているtdを削除せず非表示にしたい

    aboutをクラスとする列(以下、about列)を非表示にしようと、次のような設定をしました。 <style type="text/css"> th.about, td.about{ width:0px; border:0px; } </style> : : <table> <tr> <th class="about">右が1へのリンクになります</th> <th><a href="http://www1..com">ウェブサイト1</a></th> </tr> <tr> <tr> <td class="about">右が2へのリンクになります</td> <td><a href="http://www.2.com">ウェブサイト2</a></td> </tr> <tr> : : </tr> </table> aboutの長さ自体を0にするように設定したため、about列は表示されないはずなのですが、"右が1へのリンクになります"、"右が2への~"と表示されます。 プログラムの動作にかかわるので、about列を削除することなく、CSSなどを設定することでabout列を非表示にしたいのですが、何か上手な方法はあるでしょうか。 よろしくお願いします。

    • ベストアンサー
    • CSS
  • 表の作成

    いつもお世話になっています。 下記の構文で表を作成した際に、セルの幅がずれてしまいます。 <TABLE border="1" cellspacing="0" width="940"> <TBODY> <TR> <TH height="17" width="790" colspan="5">A</TH> <TH height="17" width="75" rowspan="2">G</TH> <TH height="17" width="75" rowspan="2">H</TH> </TR> <TR> <TH height="17" width="150">B</TH> <TH height="17" width="80" >C</TH> <TH height="17" width="220">D</TH> <TH height="17" width="280">E</TH> <TH height="17" width="60" >F</TH> </TR> </TBODY> </TABLE> <TABLE border="1" cellspacing="0" width="940"> <COLGROUP> <col width="150"> <col width="80" > <col width="220"> <col width="280"> <col width="60" > <col width="75" > <col width="75" > </COLGROUP> <TBODY> <TR height="30"> <TD><FONT SIZE="-1">○</FONT></TD> <TD><FONT SIZE="-1">×</FONT></TD> <TD><FONT SIZE="-1">△</FONT></TD> <TD><FONT SIZE="-1">□</FONT></TD> <TD><FONT SIZE="-1">◆</FONT></TD> <TD align="center"> <INPUT type="button" value="◎" style="width:55px;height:27px" onClick=""> <!-- ж --> </TD> <TD align="center"> <INPUT type="button" value="Δ" style="width:55px;height:27px" onClick=""> <!-- ☆ --> </TD> </TR> </TBODY> </TABLE> どなたか解決方法を教えていただけないでしょうか? よろしくお願いいたします。

    • ベストアンサー
    • HTML
このQ&Aのポイント
  • 純正インクを交換したにもかかわらず、エプソンPX-049Aのシアンが印字されません。
  • クリーニングを試しても改善せず、古いシアンカートリッジからはインクが漏れてくるだけでした。
  • プリンター本体の修理が必要かもしれませんが、修理に出さずに復活させる方法はありますか?
回答を見る

専門家に質問してみよう