Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Do you need to fake an anchor click? From the thickbox site:</p> <blockquote> <p>ThickBox can be invoked from a link element, input element (typically a button), and the area element (image maps).</p> </blockquote> <p>If that is acceptable it should be as easy as putting the thickbox class on the input itself:</p> <pre><code>&lt;input id="thickboxButton" type="button" class="thickbox" value="Click me"&gt; </code></pre> <p>If not, I would recommend using Firebug and placing a breakpoint in the onclick method of the anchor element to see if it's only triggered on the first click.</p> <p>Edit:</p> <p>Okay, I had to try it for myself and for me pretty much exactly your code worked in both Chrome and Firefox:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" href="thickbox.css" type="text/css" media="screen" /&gt; &lt;/head&gt; &lt;body&gt; &lt;script src="jquery-latest.pack.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="thickbox.js" type="text/javascript"&gt;&lt;/script&gt; &lt;input onclick="$('#thickboxId').click();" type="button" value="Click me"&gt; &lt;a id="thickboxId" href="myScript.php" class="thickbox" title=""&gt;Link&lt;/a&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The window pop ups no matter if I click the input or the anchor element. If the above code works for you, I suggest your error lies elsewhere and that you try to isolate the problem. </p> <p>Another possibly is that we are using different versions of jquery/thickbox. I am using what I got from the thickbox page - jquery 1.3.2 and thickbox 3.1.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload