Go To Content
codylindley.com

codylindley.com

ThickBox - One box to rule them all.

ThickBox

Update: 7/05/06

If you're like me, then your excitement is on a downward spiral as it pertains to the Lightbox technique. I'm not totally sick of the ongoing variations, but almost.

So with that said, why in the world would I be introducing ThickBox? (See the example, which is my own little twist on the Lightbox technique.) Am I a hypocrite? I hope not. My version of the Lightbox technique includes functionality similar to that of the Greybox technique. That is, ThickBox can show html pages as well as images. The html that is shown inside ThickBox is pulled from the server using AJAX (really AXAH). I would like to think that my twist is bridging the gap between Greybox and Lightbox functionality.

Before I get into what it does, I'd like to give a couple of reasons why I felt (and maybe you do too) a ThickBox type solution was needed.

  1. File size! File size! File size! Prototype & Scriptaculous can add upwards of 100k to a page unless you gzip the js files. I simply wanted a solution that was more light weight, than heavy weight. (Using the compressed version of Jquery, along with my ThickBox code, the total file size is around 20k)
  2. Lightbox made me feel like I was in a box. I wanted the ability to load (with AXAH) structural markup in the lightbox, as well as images. (A little slice of flexibility over here, please.)
  3. I needed a small abstract pattern for creating custom dialog boxes.
  4. And lastly, I wanted to demonstrate the simplicity and power of jQuery .

With my reasoning for creating ThickBox established, lets move on to what ThickBox does and why it's smooth like butter. (Smooth like butter = cool for those of you who don't speak Cody).

First off, why is ThickBox so cool? Well, because it's unobtrusive, simple to use, simple to implement, and more powerful then Greybox or Lightbox alone. Don't believe me. Let's have a look at what ThickBox does.

With ThickBox, and not unlike Lightbox in order to view a full sized image with a caption, all you have to do is create a link, add the image path (src value) to the link, provide a title value, and then give the link a class name of "thickbox". The link would look like such:

<a href="linktoImage" title="Add a caption" class="thickbox"><img src="linkToImageThumbnail" alt="Image" /></a>

Now this is where it gets interesting. If you would like to view another html document inside a ThickBox, instead of an image, you simply provide a path to the html (or htm) file. To customize the size of the ThickBox, you supply the width and height on the end of the URL. The link would look like this:

<a href="linkToHtmlFile?height=size&width=size" title="Add a caption" class="thickbox">Link Text or Image</a>

To see ThickBox in action make sure to check out the example. The ThickBox script handles the following file types.

  • .jpg
  • .jpeg
  • .gif
  • .png
  • .htm
  • .html

I can change the script if people think another file type should be added. Or, if you are js savvy you can change it yourself.

 
  1.   #1 Comment Posted by Nathan Logan on Apr 24, 01:07 PM

    Great stuff, Cody. I love the functionality.

    I think .php, .asp, and .cfm file extensions should be added by default, just to help out the server-side folks.

    Thanks for the solution – it’s a great one.

  2.   #2 Author Comment on Apr 24, 02:26 PM

    @Nathan – Thanks Nate, as for the extensions I would hope the server-side folks would avoid using specific server-side extensions on html pages sent to the browser. In a perfect world, in my head, the server should parse html pages for those specific server-side technologies. In most situations I would hope people would call a directory, and if not that then an html file. So with that in mind, I didn’t add them to the default, but I’m definitely on the fence.

  3.   #3 Comment Posted by Ryan Heneise on Apr 24, 02:47 PM

    Very nice! I can see this having some great uses for web apps – popup confirmations and such. I like the login example.

  4.   #4 Author Comment on Apr 24, 02:50 PM

    @Ryan – Hey man, thanks for the comment. I know how tempting it is to just lurk.

    Truth be told, the dialog use in web apps will likely be what I use the code for as well.

  5.   #5 Comment Posted by tyler on Apr 24, 02:57 PM

    Looks awesome, can’t wait to try it out.

  6.   #6 Comment Posted by Dennis Bullock on Apr 24, 03:22 PM

    This is great. Lightbox is growing and morphing everyday.

  7.   #7 Comment Posted by Matti Putkonen on Apr 24, 03:32 PM

    This is the most complete and compact modal window javascript I have seen so far.

    Though one potential problem: I serve my images and pages without any file extension (RoR/CakePHP way). Got any ideas if this messes up the functionality ?

  8.   #8 Comment Posted by Casey on Apr 24, 03:38 PM

    Looks like it’s not working in IE. That’s fine for us FF users, but about 90% of all web users still use IE…

  9.   #9 Comment Posted by David Merwin on Apr 24, 03:40 PM

    Nice work Codey. Very nice work.

  10.   #10 Author Comment on Apr 24, 03:47 PM

    @Dennis & Tyler – Thanks guys.

  11.   #11 Author Comment on Apr 24, 03:47 PM

    @Casey – Sorry, it works fine in IE. Glitch on my part. Which I fixed. Sorry about that. If you grabbed the source already, you should update the CSS file and everything will work fine in IE.

  12.   #12 Comment Posted by Ruby on Apr 24, 04:06 PM

    Beautiful! Sheer genius! Quick question—I think it was asked above…can I still use this if I’m linking to a file but it doesn’t have an extension ala a content management system?

  13.   #13 Author Comment on Apr 24, 04:11 PM

    @Matti – Currently you can only include .htm and .html pages (This is easy to change in the JS.) Thickbox includes html blocks using AJAX. I’m not sure how one might include files from a framework where no file is called.

  14.   #14 Comment Posted by Mateus Neves on Apr 24, 04:15 PM

    Very nice!!!! Contratulations :o) and tanks…

  15.   #15 Comment Posted by Volkher Hofmann on Apr 24, 04:19 PM

    Cool.
    I’d take it. ;)

  16.   #16 Comment Posted by Patrick Fitzgerald on Apr 24, 04:42 PM

    Nice! Would be cool if there could be a way to cancel the loading screen though; on a slow connection you might get stuck waiting for the image to load.

  17.   #17 Author Comment on Apr 24, 04:43 PM

    @Patrick F. – Good idea, I can see that in the next version.

  18.   #18 Comment Posted by Dave Lowe on Apr 24, 04:57 PM

    That is awesome, Cody! Nice work. I think I’m going to have to use this.

    It looks there’s a slight bug using it on Safari. When scrolling the page, the thickbox content gets whited out from below. I don’t know if that’s a bug with Safari itself or not. Not a big deal though even if it’s incurable.

  19.   #19 Comment Posted by Mike Rumble on Apr 24, 05:09 PM

    Dave, I’ve just noticed that slight bug in Safari too. Only seems to happen with the HTML thickboxes, not the images.

    There’s a screenie here: http://www.flickr.com/photos/mmmmike/134436424/

  20.   #20 Comment Posted by Matti Putkonen on Apr 24, 05:25 PM

    the missing file extension was pretty easy to compensate:

    $(“a.delete, a.move”).click(function(){

    var t = this.title || this.innerHTML || this.href; TB_show(t,this.href +’/ajax/.htm?height=300&width=300’, ‘page’); this.blur(); return false;
    });
  21.   #21 Author Comment on Apr 24, 05:28 PM

    Dave L & Mike M. – I’m using safari 2.0 and not seeing any issues. What version are you guys using?

  22.   #22 Author Comment on Apr 24, 05:38 PM

    @Matti P. – Nice! Are you using Cake or RoR?

  23.   #23 Comment Posted by Matti Putkonen on Apr 24, 06:07 PM

    Cake. Pretty close to impossible to find hosting for RoR here in Finland. And I am too old to learn an new language :)

  24.   #24 Comment Posted by Corey on Apr 24, 06:13 PM

    Brilliant, can’t wait to look under the hood for myself…well done.

  25.   #25 Comment Posted by Anthony on Apr 24, 11:11 PM

    Thats beautiful, great work cody! I will be sure to try this out on a few sites :)

  26.   #26 Comment Posted by Anthony on Apr 24, 11:34 PM

    edit:

    How would i go about using it with dynamic php? I would love to use it for the prayer card section on a site im developing.

    heres a sample of a listing:
    http://www.wcmp.org/visitations/17758/Anthony-S-LeBoeuf.html

  27.   #27 Comment Posted by Ritz on Apr 24, 11:56 PM

    Great work homey! That’s definitely getting used as soon as possible.

    P.S. I should be in B-Town in a few weeks, we should play some shuffleboard!

  28.   #28 Comment Posted by Abba Bryant on Apr 25, 01:09 AM

    Just a quick observation. The submit button in your login form example does nothing. The lightbox stays open. Is that supposed to be that way?

    I’ll look at the code and see if it is intentionally a stripped down example.

  29.   #29 Comment Posted by Abba Bryant on Apr 25, 01:19 AM

    Silly me. No form tag in there even. Awesome work.

    For anyone who asked about dynamic pages..
    I believe the jquery load function works just find when using a php page as the source.
    If you changed the section handling the “urlType ==” to allow for php/php3/php4/php5 as extensions then it should be easy enough to have your script serve up xhtml and insert it.

    I am also fairly certaion that you can pass get parameters apended to the src url. The same script could be capable of being ajax or otherwise. I might play with having the ajah content in complete pages, perhaps server side by skipping that part of the template render if dynamic or client side – perhaps grabbing the body node somehow through the dom? Can I do that on remote content without loading the document somewhere? Hidden Iframe perhaps?

  30.   #30 Comment Posted by Joram Oudenaarde on Apr 25, 02:42 AM

    Call me crazy, but I can’t seem to find a downloadbutton for Thickbox. :-)

    It does seem like an extremely light(box)version though… the pop-”in” loads incredibly fast compared to Lightbox, and doesn’t break. I found that with Lightbox2 the layout of the pop-in looked a bit flimsy sometimes.

    Can’t wait to see it working in my own webby!

    That reminds me… are you planning on making a Wordpress-plugin by any chance?

    With kind regards,
    Joram Oudenaarde

  31.   #31 Comment Posted by Webdawson on Apr 25, 02:48 AM

    This is Wonderful!

  32.   #32 Comment Posted by suexID on Apr 25, 03:01 AM

    Wonderful script, I’ll integrate it into my blog! Thanks for sharing it with us! :)

  33.   #33 Comment Posted by Pierre Nel on Apr 25, 03:41 AM

    It seems like all the lightbox scripts only do something after following an href – is there no way to make the lightbox appear after clicking the submit button on a form? And then get the POST info mangled by some php which appears in the lightbox? :-/

  34.   #34 Comment Posted by David Wang on Apr 25, 04:48 AM

    Hi Cody, your thickbox is totally great.. though the name will take a bit of getting used to.

    If you’re going to continue development on thickbox, why don’t you create a separate section on your site for it?

    Thanks for the script!

  35.   #35 Comment Posted by Phil Cooper on Apr 25, 05:45 AM

    This looks great.

    I’m working on a little JS RPG game at the moment, and need something slick for popping up dialoge boxes and status screens – ThickBox will be perfect :)

  36.   #36 Comment Posted by Taylor on Apr 25, 05:53 AM

    I can see this being useful for several things that I’m working on.

  37.   #37 Comment Posted by Yaakov on Apr 25, 06:20 AM

    Your script works great on the example page. I have tried to implement it on http://www.ellisweb.net/2006/03/google-finance-released/
    but for some reason the functionality is not working. I have added the script references in the header, and set the link class to “thickbox”. Anything else you can see that I am missing?

    Thanks

  38.   #38 Comment Posted by Frederic on Apr 25, 06:43 AM

    Looks very nice, one thing would make it even better:

    If JS is disabled, you don’t get a valid html-page but just a snippet of code included.

    For including html with ThickBox it would be nice to link complete html-files whith a kind of block marker being stripped by ThickBox.

    Example:
    [HTML]
    ...
    ...
    [BODY]
    [!—THICKBOX BEGIN—]
    [P] here goes the content[/P]
    [!—THICKBOX END—]
    [/BODY]
    [/HTML]

    (replace the brackets)

  39.   #39 Comment Posted by Tony on Apr 25, 08:44 AM

    Download?

  40.   #40 Comment Posted by frequency decoder on Apr 25, 09:13 AM

    Sweet piece of coding young man!

    Frederic’s idea (comment #38) of marking the imported X/HTML files shouldn’t take much code to integrate using a nifty regular expression i.e.

    It will actually take more than one regExp to do it as we are attempting to parse HTML content sandwiched betweend HTML comments (nightmare scenario)

    The following will match everything after the<-- THICKBOX_BEGIN -->

    content.match(/THICKBOX_BEGIN([\s]+)?(\/\/)?\-\->(.+)/g)[0].replace(/THICKBOX_BEGIN([\s]+)?(\/\/)?\-\->/,"")

    But the result of this will have to be ran against another regExp that matches everything up until the<-- THICKBOX_END --> (or <-- TH if your feeling lazy)

    You can check out what I mean by pasting this into the FF JS console and clicking the "evaluate" button:

    alert("hello<-- THICKBOX_BEGIN //-->blah
    blah<-- THICKBOX_END -->".match(/THICKBOX_BEGIN([\s]+)?(\/\/)?\-\->(.+)/g)[0].replace(/THICKBOX_BEGIN([\s]+)?(\/\/)?\-\->/,""))

  41.   #41 Comment Posted by frequency decoder on Apr 25, 09:15 AM

    Aaahh, Textile seems to have eaten half of the above regular expression and the grand finale of my comment, apologies…

    Again, great work and a nice introduction to jQuery for the uninitiated.

  42.   #42 Author Comment on Apr 25, 09:29 AM

    @frequency decoder – You’ve got to love and hate textile. BTW – thanks for the accolades, means a lot coming from you!

  43.   #43 Author Comment on Apr 25, 09:43 AM

    @Frederic – Good idea, I was thinking alone these lines at one point but felt that the files being created for the ThickBox should be left untouched for the initial launch. I wanted to keep things simple and flexible for everyone. If that makes sense… I am however in agreement that it would be better to server the correct DTD and html elements to the browser when js is disabled.

    @Yaakov – Do you have the style sheet in place from the example too?

    @ Pierre Nel – Currently the functionality you mentioned is not possible with ThickBox, however I will give some thought in coming versions as to how one might invoke ThickBox with an input button.

    @ Joram Oudenaarde – I do not see a Wordpress-plugin from me, in the future. However, you might see it from the community over the next couple of months.

    @ Abba Bryant – Yup, no form tag…just an example of what can be done.

    @All – I can add a zipped download of the example if that will help people…what do you all think?

  44.   #44 Comment Posted by Jason Levine on Apr 25, 09:56 AM

    Looks nice. I think I’ll use this on a redesign I’m working on.

    Two questions though, the new version of LightBox can be used to group images. You can then click the “previous” or “next” buttons to go back or forward. Would there be any way of integrating previous/next buttons into ThickBox? (Lightbox does it via a rel=”LightBox[GroupName]” tag.)

    Also, how would this work with a link that had more than one class assigned to it? Would it still work if the class was set to “Thickbox Bold Italic”?

  45.   #45 Comment Posted by benp on Apr 25, 10:11 AM

    ooh, that’s very nice!
    any chance we can have more info on how to implement it for us, newbies? :”)

  46.   #46 Author Comment on Apr 25, 10:16 AM

    DOWNLOAD ADDED – People requested it, and others are having trouble extracting the code from the example so a zipped download of the example and dependant files were just added to the example page. (link appears at top of page)

  47.   #47 Comment Posted by benp on Apr 25, 10:19 AM

    Thank you Cody!
    That helps a lot :)

  48.   #48 Comment Posted by Jason on Apr 25, 10:27 AM

    Looks interesting. I downloaded the example files and was taking a look at thickbox.js.

    I’ve never seen $ notation in javascript before – how does it work?

  49.   #49 Comment Posted by Patrick Haney on Apr 25, 10:27 AM

    Great work Cody, I was looking for a Lightbox JS script that would allow me to easily use HTML pages inside the box rather than just an image, so you just saved me a lot of work (not to mention file size with Jquery).

    One thing I noticed in IE6 though is that while everything worked fine, scrolling the browser also scrolled the ThickBox as well (whereas Firefox keeps the box centered in the browser window).

  50.   #50 Comment Posted by Josh on Apr 25, 10:46 AM

    Hey Cody, great work on this! I wonder how PDF files would hold up in this? Have you consider adding that extension?

  51.   #51 Comment Posted by Sebastian on Apr 25, 11:12 AM

    Hi! Nice work!

    I am using tightbox for embedding html.

    Under FF Win32 and FF Gnu/Linux the shading/modality only works if the document has scroll bars.

    If the document has no scrollbars then the grey shade that visually marks the document as inaccessible flashes but disappears immediately.

    So the user can open the popup again and again, the popups stack up.

    Can anyone confirm this?

    cu
    Sebastian

  52.   #52 Author Comment on Apr 25, 11:36 AM

    @Jason – Take a look at Jquery. The use of $ is an abstraction of sorts from the Jquery code.

    @Patrick Haney – Yup, IE 6 (all of them for that matter) does not like the fixed position on the ThickBox div. So in the css I serve up an absolute value for the position to IE. I’m going to try and tackle a solution for the next update. If you figure out a work around let me know.

    @Josh – Well, a person could include a pdf in the block of html that is being pulled into the ThickBox. You would have to make the ThickBox rather large depending upon how you were thinking a person would view the pdf file.

    @Sebastian – I am not seeing these issues on Win32 FF 1.5. As for Linux, I can’t check that. Strange, I never saw that issue. The overlay was always the most consistent part of the code.

  53.   #53 Author Comment on Apr 25, 12:02 PM

    A WordPress plugin has been created. (Thanks anieto2k) Get it here.

  54.   #54 Comment Posted by Curt on Apr 25, 12:29 PM

    This looks great.

    Is there a way to make this active from an image map?

    Thanks

  55.   #55 Comment Posted by John Wiseman on Apr 25, 12:52 PM

    Amazing! Love it. Looking forward to the next version. Cheers

    http://www.johnwiseman.ca

  56.   #56 Comment Posted by Dan on Apr 25, 01:53 PM

    Has anyone figured out how to change the tab order to achieve true modality (sp?).

    I have notfound a JS “modal” window that prevents the user from tabbing into the background.

    The ideal behavior would be to allow a user to tab around in the modal window without returning to the backgrounded area.

    Also, does thick box compensate for IE’s windowless select boxes? Or do they show through the modal window?

    Cheers!

  57.   #57 Comment Posted by Craig Clayton on Apr 25, 01:54 PM

    Am I an idiot? I dont see the download link…

  58.   #58 Comment Posted by www.FreeTrialOfferGuide.com on Apr 25, 02:15 PM

    I can’t wait to use this!

  59.   #59 Comment Posted by Michael Long on Apr 25, 02:34 PM

    Re: Safari (2.0.3) and the whiting out of the text in an HTML box … It seems to happen when I scroll using the track pad method (two-finger) but it works fine if I use the actual scroll bars.
    Other than that it works beautifully. And so much lighter than the other lightbox solutions I’ve tried.

  60.   #60 Comment Posted by Chuck on Apr 25, 02:41 PM

    Very nice, very smooth. I dunno if anybody else has asked, but will this have support for Galleries (multiple images) the way Lightbox 2.0 does?

    Thanks for kicking something serious.

  61.   #61 Comment Posted by Yaakov on Apr 25, 02:42 PM

    Added the styles, it is working now.

    Thanks for the help and the great functionality!

  62.   #62 Comment Posted by Chuck on Apr 25, 02:49 PM

    I found a slight bug. When the loading indicator is spinning, if you click somewhere it breaks in a strange way. Just thought you should know!

  63.   #63 Comment Posted by Charles Richardson on Apr 25, 02:52 PM

    Has anyone come up with the code for putting the Close button upper left so it will always be visible? I’m terrible with Javascript, so I haven’t been able to get that to work…

  64.   #64 Author Comment on Apr 25, 02:54 PM

    @Chuck – I can’t seem to replicate the bug you spoke of on FF win32 and IE. Are you using Safari?

  65.   #65 Comment Posted by Abba Bryant on Apr 25, 04:16 PM

    I just checked ff on win and *nix and have not been able to get it to glitch as mentioned.

    Also (being a jquery fan myself) have a mostly working patch the js that can allow you to perform $(“body”) selection on the returned src in the ajax .load function. (basically allowing you to return the entire html document and then select a portion of it from there for insertion.)

    When it works right I will post a patch to the jquery mailing list.

    Have you asked John Resig about this issue? He might have some pearls of javascript genius for us.

  66.   #66 Comment Posted by Paul Armstrong on Apr 25, 04:26 PM

    Have you thought about adding formats like .mov, .avi, .flv, .mpg etc?

  67.   #67 Comment Posted by Paul on Apr 25, 09:01 PM

    Yeah I must be an idiot too.
    Can’t find the Download link anywhere.

  68.   #68 Author Comment on Apr 25, 09:21 PM

    Download link should be backup now. Refresh.

  69.   #69 Comment Posted by Michael on Apr 25, 10:12 PM

    Is ThickBox supposed to be modal? On any of the examples if I click outside the Thickbox it disappears and the overlay goes away effectively putting me back where I started. Thx!

  70.   #70 Comment Posted by Sherwin Techico on Apr 25, 11:11 PM

    Great job Cody. Like @Ryan said above, its sure will be useful in web apps.

  71.   #71 Comment Posted by Marcel Panse on Apr 26, 03:10 AM

    It seems the jquery.js messes up the DWR javascript classes. So, DWR won’t work with thickbox.. Anyone experiencing the same problem?

  72.   #72 Comment Posted by Eourus on Apr 26, 04:47 AM

    I have a problem with IE. But concretely with tag select.

    I put captures to you.

    Firefox:
    http://www.quakecult.com/download/confirefox.jpg

    IE:
    http://www.quakecult.com/download/conie.jpg

  73.   #73 Comment Posted by Peter Rehm on Apr 26, 05:02 AM

    Is there any possibility to click on an Link in the Thickbox itself, and this Link is opened in the same Thickbox?

    This would be very useful for web applications!

  74.   #74 Comment Posted by maro on Apr 26, 06:11 AM

    the grey background looks strange(not transparent and doesn’t hide all page[only visible part]) under opera/linux.

  75.   #75 Author Comment on Apr 26, 06:39 AM

    @Michael – No, currently Thickbox will allow the user to escape the content shown.

    @Marcel Panse – Really, are you using the compressed version?

    @Eourus – Yup, I’ll have to add a solution in the next realease for selects.

    @Peter Rehm – I’m thinking about functionality similar to this on the next release. It would allow the user move from a Thickbox to another Thickbox.

    @Maro – Yup, didn’t check it on opera/linux.

  76.   #76 Comment Posted by Eourus on Apr 26, 06:44 AM

    Thanks

  77.   #77 Comment Posted by Replay2x on Apr 26, 08:13 AM

    @post #20: – I’m trying to link to a page that does not have a .htm/html extension. Where would you paste this code? TIA!
    ———-

    $(“a.delete, a.move”).click(function(){
    var t = this.title || this.innerHTML || this.href; TB_show(t,this.href +’/ajax/.htm?height=300&width=300’, ‘page’); this.blur(); return false;
    });
    ———-

  78.   #78 Comment Posted by Curt on Apr 26, 08:51 AM

    Is there a way to have thickbox open a htm file using a image map instead of a href link.

    Thanks

  79.   #79 Comment Posted by Mike on Apr 26, 08:54 AM

    Do forms in the thickbox actually work? A different lightbox variation also showed a form in the box in the demo, however in actual use there was no way to get such a form to submit correctly. Has anybody used forms successfully with thickbox?

  80.   #80 Comment Posted by Joe Danziger on Apr 26, 09:13 AM

    Excellent work!!!

    Is it possible to add a ‘close’ link manually besides the one that’s automatically generated?

    Also, in regards to being modal, the outside content scrolls when the mouse is over it. That content should probably be locked while the thickbox is active.

  81.   #81 Author Comment on Apr 26, 09:14 AM

    @Mike – Well, yes. A form element can be added to the html calling (AXAH) the html block, or to the html block itself. Of course this is not plug-and-play type stuff. A good understanding of JS is required.

  82.   #82 Comment Posted by Adam on Apr 26, 09:29 AM

    Works fine in Opera 9.0 TP2 =)

  83.   #83 Comment Posted by Nicola M. on Apr 26, 09:35 AM

    I’m loving it, thanks Cody :)

  84.   #84 Comment Posted by Amy on Apr 26, 09:44 AM

    How do you make a slide show with this? Thank you!

  85.   #85 Comment Posted by Dave Lowe on Apr 26, 10:20 AM

    On the Safari issue, I’m using 2.0.3 and I’ve got more fun details. :) I use a mouse with a scroll wheel so I tried using the scroll bar instead and had the same results. I also tried the two-finger trackpad scroll and page up/page down — same whiting out.

    Not one to be beaten at troubleshooting, I tried everything else I could think of until I concluded that every method that defeated the wipe-out never works consistently. So…. good luck with that. ;) It feels like a Safari bug, not anything wrong with the ThickBox code.

  86.   #86 Comment Posted by Tom on Apr 26, 10:23 AM

    Great work, I think I will use it soon.

  87.   #87 Comment Posted by JPow on Apr 26, 12:01 PM

    Does anyone know how you would contain this in a div ?

  88.   #88 Comment Posted by Burton on Apr 26, 12:17 PM

    I’m having a little trouble with the CSS. It’s conflicting with my site’s current CSS file since a lot of the selectors are the same: p, table, ul, etc. Is there a way for it to co-exsist with another CSS file?

  89.   #89 Author Comment on Apr 26, 01:26 PM

    @Burton – Only the styles that begin with TB_ are required. Change, delete, or add too anything else. Unless of course you want to change the styles I created for ThickBox.

  90.   #90 Comment Posted by Aaron on Apr 26, 01:42 PM

    I really dig this Cody. I found one quirk. If your jpegs have uppercase file extensions thickbox will not display them. The page goes grey but no image is displayed. Took me a minute to figure out why they weren’t working. I haven’t tried with png or gif, but I imagine it’s the same. Just thought I’d throw that out there in case someone else has the same problem.

  91.   #91 Author Comment on Apr 26, 01:50 PM

    @Aaron – Great catch, I in fact did not account for variations in the case of the extension. I appreciate you bringing it up here in the comments.

  92.   #92 Comment Posted by René on Apr 26, 04:27 PM

    I have the same problem that the shading/modality only works if the document has scroll bars. But I’m on FF 2.0a1 build 2006042512.

  93.   #93 Comment Posted by Danny Foo on Apr 26, 08:45 PM

    Very neat indeed! And kudos to the evolution of the Greybox, Lightbox technique. :)

  94.   #94 Comment Posted by Paul on Apr 26, 09:13 PM

    I’ve added it to my blog and without changing any code in between tries, sometimes it will work and then it won’t work (opens the pics in a new window), then it will start working again. Go wonder.

  95.   #95 Comment Posted by Luke on Apr 26, 09:41 PM

    This is great!! Even works in internet explorer 6… Although any flash content on the content on the page appears above it?

  96.   #96 Comment Posted by Paul on Apr 26, 09:49 PM

    Yes, working with maps would be cool too… ;-)

  97.   #97 Comment Posted by Mal Jones on Apr 26, 10:42 PM

    Hey, this is great. It’s so much smaller than the new version of Lightbox and the auto-centering features solves a bug that’s in Lightbox (when a picture is larger than the viewing window, the overlay doesn’t work). But here if the picture is larger than the viewing window, there are no scrollbars on the browser itself. Is there someway to turn them on?

  98.   #98 Comment Posted by Daisaku "Valerry" Tsutsui on Apr 27, 01:49 AM

    This is great.Nice work Cody.
    May I introduce “ThickBox” with my Blog for Japan?
    (sorry. my comment is poor English.)

  99.   #99 Author Comment on Apr 27, 07:26 AM

    @Daisaku – Sure, use what you like.

    @Mal – What browser are you using?

  100.   #100 Comment Posted by Mal on Apr 27, 08:42 AM

    I’m using Firefox 1.5 both Mac and PC. The test page I’ve set up is at http://www.maljones.com/painting-koi-rhiannons2.html

  101.   #101 Comment Posted by John on Apr 27, 11:24 AM

    Good stuff!

    Played around with the script and example a bit and on IE 6, if you scroll down any and open a thickbox, the box is centered on the original view not the current view. So if someone had a link to a thickbox at the end of a page, the thickbox would load at the top. Whether it was visible or not would depend on how much they scrolled down.

    Another good feature would be the option to resize large images to fit the view screen. Similar to Lightbox Plus.

  102.   #102 Comment Posted by Alec on Apr 27, 12:34 PM

    This is really great Cody! I would also like to use it with PHP files but I’m not sure how to edit the JS to allow them. Can somebody either explain it to me or send me an updated file so I can use PHP files with it? Thanks

  103.   #103 Comment Posted by CJ Lewis on Apr 27, 12:48 PM

    This is really cool and makes sense to use it for html as well.

    Few problems:

    1. On IE 6 – Sometimes upon refresh the pop up windows does not show and it ends up open a full size window. This is not happened on IE 7 Beta 2.

    2. Again on IE 6, the window is not centered when/if the link is on the bottom of the page. It automatically jumps the page up to open the window. Lightbox had a similar problem and they fixed it on their 2.01 release.

    But overall, this is a lot better and has greater funtionality.

    Thanks for the work.

  104.   #104 Comment Posted by Mal on Apr 27, 03:53 PM

    I managed through some CSS playing to have the content not be absolute, but now when the Thickbox is accessed on roughly 800×600 sized windows, the top of the image is above the top of the page.

    Curiouser and curiouser. Almost there and still a great program.

  105.   #105 Comment Posted by Harry on Apr 27, 08:54 PM

    First of all, thanks for this. I love the fact that it also loads HTML.

    Two issues:
    1) I want to load a page that contains an embedded Flash movie. Upon clicking my link, the modal window appears but the Flash movie does not.

    2) Is there any way to ease the transition of the removal of the gray page overlay upon closing the window? The default transition is somewhat jarring.

  106.   #106 Comment Posted by Ryan on Apr 27, 10:32 PM

    http://scc04.servehttp.com/istudent/index.php

    (Click the login link)
    Any idea why the overlay is not working correctly in IE6? I Fixed it in FF using this hack:

    html[xmlns] #TB_overlay {
    z-index:100 !important;
    width: 100% !important;
    height: 100% !important;
    }

    but with IE that did not work. (Which is why I had to turn it into a hack for FF)

    Any help or ideas would be great! Thanks.

  107.   #107 Comment Posted by Robert Mao on Apr 28, 01:16 AM

    Nice code! But I find a bug, maybe you can fix in the next version.

    If the ThickBox was palced in some URL contain “html, htm, etc.” in the path, it will not display correctly.

    e.g.

    http://site/html/testtb.html

    will not work.

    I have fixed by my own change of the code, but I guess you would like to improve it officially. :)

    cheer, thanks for you great code!

  108.   #108 Comment Posted by Robert Mao on Apr 28, 01:29 AM

    Just in case if some one else meet same problem as me, I paste the bug fix code here:

    in thickbox.js:

    change:
    var urlString = /.jpg|.jpeg|.png|.gif|.html|.htm/g;

    to:

    var urlString = /\.jpg|\.jpeg|\.png|\.gif|\.html|\.htm/g;

    Pls. notice this code is still not 100% correct, because a directory could be named as “xxx.xxx”.

  109.   #109 Comment Posted by Graham Greensall on Apr 28, 05:21 AM

    Codey, this is really awesome – thanks for sharing.

    Couple of newbie Q’s please. Can the opacity of the background page be changed – it’s too dark for my taste, and is it possible to add text to the title bar?

    Thanks again

  110.   #110 Comment Posted by Graham Greensall on Apr 28, 05:35 AM

    Apologies Cody – can’t even spell your name – great way to get a response !!

  111.   #111 Comment Posted by Håvard Pedersen on Apr 28, 06:10 AM

    Try opening the thickbox img example in firefox with a window smaller than the image you display. There is no way to reach the close link. :(

  112.   #112 Comment Posted by Gavin on Apr 28, 07:39 AM

    Is there any way of making the window behind the content transparent?

    Cheers

  113.   #113 Comment Posted by swordfish23 on Apr 28, 08:30 AM

    hey guys, i have the same problem in firefox – take a look at my gallery http://www.swordfish23.de/sw23/misc/ to see what the problem is -> if you resize to 800×600 and click on the first image you can’t reach the close button.

    the problem is, that the imagebox has a “position:fixed” and when the image is larger than the viewport, the script is giving this box a negative left-value for its position.

    if have modified the code a bit and in my local test’s it worked out for me:

    js:

    fixedleft = ((w – TB_WIDTH)/2);
    if (fixedleft < 0) { fixedleft = 0; }
    $(”#TB_window”).css({width:TB_WIDTH+”px”,height:TB_HEIGHT+”px”,
    left: fixedleft+”px”, top: ((h – TB_HEIGHT)/2)+”px” });

    css:

    #TB_window[id] {
    position: absolute;
    }

    well, i believe cody has a nicer lookin’ idea to fix that issue, but this is my general idea for this problem

  114.   #114 Author Comment on Apr 28, 08:31 AM

    @Gavin – Yes, change these values in the CSS.

    filter:alpha(opacity=60);
    -moz-opacity: 0.6;
    opacity: 0.6;

  115.   #115 Author Comment on Apr 28, 08:36 AM

    @Graham Greensall – Title bar for html pages is currently not possible. I will work this into my next version.

    BTW – See my response to Gavin.

  116.   #116 Author Comment on Apr 28, 08:38 AM

    @Robert Mao – Great feedback, and example. I will address this in the next release.

    @swordfish23 – Yup, I’m thinking along those lines myself, but not sure yet. At any rate I will address the issue in the next version.

  117.   #117 Comment Posted by Gavin on Apr 28, 08:51 AM

    Sorry I meant the loaded HTML background transparency.

    Cheers

  118.   #118 Comment Posted by Drake on Apr 28, 12:08 PM

    Great Work!!!
    I am wondering is it possible to do image set as lightbox js v2.0? If it can do that, I think I will change to ThickBox asap. lol~

  119.   #119 Comment Posted by Craig on Apr 28, 03:20 PM

    Yeah… the one thing that is keeping me from switching from Lightbox 2.0 is the image set functionality.

    I’m pretty sure that you can’t do class=”thickbox[setname]” because classes can not contain symbols.

  120.   #120 Comment Posted by Jason on Apr 28, 03:54 PM

    Anybody get .swf or .mov to work in this yet? I can get it to play but when I click on close it forces Safari to quit. Also, if I try it in Mac FF it plays the audio from my movie but not the video. Any ideas?

  121.   #121 Comment Posted by Ryan on Apr 28, 05:30 PM

    Hey Cody, sorry to bug you again but did you get a chance to read my post earlier? [BTW. Great code you have come up with. We all really appreciate anyone who gives their time and effort into helping the open source movement. I myself will be one of them very soon. Anyways, this was my previous post but I never got an answer. Thanks again!]—-

    http://scc04.servehttp.com/istudent/index.php

    (Click the login link)
    Any idea why the overlay is not working correctly in IE6? I Fixed it in FF using this hack:

    html[xmlns] #TB_overlay {
    z-index:100 !important;
    width: 100% !important;
    height: 100% !important;
    }

    but with IE that did not work. (Which is why I had to turn it into a hack for FF)

    Any help or ideas would be great! Thanks.

  122.   #122 Author Comment on Apr 28, 05:37 PM

    @All – Today is my 30th birthday. So, I will likely not catch up with the comments posted here until next week. Sorry, and we’ll see you all next week.

  123.   #123 Comment Posted by Richard on Apr 28, 11:40 PM

    Hope you had a great birthday.

    Like #84 Amy, I too need slide show capability. Also, will Thickbox display inline div’s? I don’t want to create separate html files for the “small stuff.”

    Am currently using both Lightbox JS (slide shows) and Leightbox (content from inline div’s). Would be nice to have one script that does both.

  124.   #124 Comment Posted by DragonFlyEye.Net on Apr 29, 03:24 PM

    Hmmm. . . having a heck of a problem, which I assume to be CSS-related, with Thickbox on WordPress. Granted, this is the WordPress plugin developed by this guy, but I don’t know that it’s a specific problem with it being a plugin, exactly.

    I’ve setup a test post here.

    For some reason, it’s working dandy in IE, but not in FireFox, to my chagrin. Like I said, I assumed it’s a problem with the CSS, somehow, but if you have an idea how to get around this problem, I’m all eyes. Thanks, and thanks also for the great code!

  125.   #125 Comment Posted by DragonFlyEye.Net on Apr 29, 03:36 PM

    OK, so you strip the URLs. Here’s the link to the test:

    http://www.dragonflyeye.net/blog/2006/04/28/testing-thickbox-plugin/
    http://www.dragonflyeye.net/blog/2006/04/29/testing-thickbox-plugin-part-deux/

  126.   #126 Comment Posted by DragonFlyEye.Net on Apr 29, 10:21 PM

    Uh. . . Sorry to keep posting. Hope this doesn’t come across as spam, but I’m working on the issue and finding new things.

    OK, so what appears to be the problem is a bit of code in my footer. I know it’s not your business to troubleshoot someone else’s code, but I’m wondering if you can think of any good reason that this code would be a problem.

    The code is just a Performancing stats counter. When I remove it, the Thickboxes work fine. I’d prefer not to ditch this code, but I don’t know exactly what the problem is (I was lucky enough just to have stumbled on the problem as it was!). Is there any particular reason that JavaScript code inserted into the footer of a page would inturrupt the Thickbox thing? I cannot imagine why, but then I don’t know a whole lot about JavaScript in the first place.

    I really appologise for the over-posting!!!

  127.   #127 Comment Posted by Dave Reid on Apr 30, 12:30 AM

    I’m working on the problem that DragonFlyEye.Net is having with the Performancing code. Right now from what I can tell, there seems to be a conflict in onclick events. I’ll try and continue debugging the problem.

  128.   #128 Comment Posted by iLEZ on Apr 30, 04:41 PM

    Great script!
    Like some other people, i have some problems with uppercase files. Working around it though. =)

  129.   #129 Comment Posted by kartooner on Apr 30, 09:50 PM

    Cody: What if I’m too “thick” to use Thickbox? What then?

    All kidding aside, this is super slick man.

    Oh, and Happy Belated Birthday wishes. Do you feel 30? ;)

  130.   #130 Comment Posted by Mal Jones on Apr 30, 11:00 PM

    Thanks for all the help everyone. I did some local testing here and it looks like swordfish23’s fix (I also applied that to a fixedheight) did the job. Tomorrow I test on a ton of browsers on PC.

  131.   #131 Comment Posted by Charlie Hazlett on May 1, 01:04 AM

    I love it, too, but I want to use PHP as well. I hoped to use it with a contact form, but it will not work on PHP. I tried embedding the php in an html page, but no good, it came up blank.

    What to do ???

  132.   #132 Comment Posted by Maciek Kus on May 1, 05:34 AM

    Hello!
    Great script!
    But when using ThickBox with links to images, firefox can’t read title attribute value.

    //add thickbox to href elements that have a class of .thickbox
    $(document).ready(function(){//when the document is loaded
    $(“a.thickbox”).click(function(){

    var t = this.title;

    ‘t’ is always empty,
    while in IE it goes well.
    Any help?

  133.   #133 Comment Posted by Rich Schmidt on May 1, 04:13 PM

    I’m needing to implement a fix similar to swordfish23’s, except with height (a little help, Mal Jones?). The problem is, I don’t know js. I thought I found the right place to insert sw23’s code, but I must have goofed, because it quit working altogether – just brought up the pic on a page by itself.

    Of course, if the user has scrolled down the page a bit, I don’t want the top of the picture to be off the page… so thickbox isn’t quite there for me, yet. But I like its lightweight nature! I don’t want something as bulky as lightbox.js on my site.

    I guess I’m eagerly awaiting the next release… or some more detailed help in the comments…

  134.   #134 Comment Posted by Montoya on May 2, 12:55 AM

    Great job Cody, I was thinking to make something like this, but you’ve done all the work for me :)

  135.   #135 Comment Posted by Scott on May 2, 06:54 AM

    In case anyone needs to dynamically load a thickbox (eg you want to show it after an AJAX request rather than when clicking on a link) simply use the function:

    TB_show(“test”,”ajaxLogin.htm?height=100&width=250”);

  136.   #136 Comment Posted by Branndon on May 2, 11:01 AM

    I’m trying to open a video in the thick box. Embeding the video and adding a title to it isn’t a problem, but I want the background of the thickbox to be black, not white. I’ve only been messing with this for a half hour or so. But if anyone can help me out I’d appreciate it.

  137.   #137 Comment Posted by Mal Jones on May 2, 04:00 PM

    @Rich: I applied the fix like this:

    fixedleft = ((w – TB_WIDTH)/2);
    if (fixedleft < 0) { fixedleft = 0; }
    fixedheight = ((h – TB_HEIGHT)/2);
    if (fixedheight < 0) { fixedheight = 0; }
    $(”#TB_window”).css({width:TB_WIDTH+”px”,height:TB_HEIGHT+”px”,
    left: fixedleft+”px”, top: fixedheight+”px” });
    $(”#TB_overlay”).css(“height”,yScroll +”px”);

    It goes right where you put swordfish23’s fix. I don’t know Javascript that well either, but it helped that I know Actionscript some.

  138.   #138 Comment Posted by Mal Jones on May 2, 04:03 PM

    I just saw that you said it stopped working. I’d say grab down a new copy of the .js file and check out the thickbox.js file at my site (www.maljones.com/js/thickbox.js). I also had to change the css some, so check out www.maljones.com/css/global.cs.

    I’m terrible at explaining this stuff succiently.

  139.   #139 Comment Posted by Zaim on May 3, 01:22 AM

    The background overlay isn’t working on my Opera 8.51. It’s 100% opaque, with no transparency.

    Great work anyways!

  140.   #140 Comment Posted by lapster on May 3, 01:39 AM

    I’ve seen a few posts for loading php/flash and my solution was to create a page with just the code for an iframe in it sourcing to the file you want to load (tested with php but not swf).

    example site – click the portfolio link:
    http://www.metalandglass.com/test/

    Great work, Cody. Alot of fun!!! I look forward to the next release…

  141.   #141 Comment Posted by Zaim on May 3, 04:50 AM

    I should’ve researched first before posting my previous (#139) comment – Opera 8 does not support CSS opacity at all.

  142.   #142 Comment Posted by Omatsei on May 3, 08:36 AM

    I ran into a strange problem where it’ll remember the contents of the html file it loads (it’s not kept in cookies or cache, I cleared both). How difficult would it be to put a button on the top that would refresh the contents of the thickbox?

    Disclaimer: I’m using an ajax request to pull the page with the thickbox links, using Scott’s method (#135).

  143.   #143 Comment Posted by Rich Schmidt on May 3, 09:10 AM

    Thanks, Mal. I grabbed your .js file, but the .css file link gives a 404, on both .cs or .css.

    I’ll play with it a bit. Maybe I can figure it out now. :)

  144.   #144 Comment Posted by Jeremy on May 3, 12:19 PM

    I am having a strange problem trying to load an .swf file through thickbox. I am able to play the .swf (a video) but in Firefox I cant use the pause/play buttons, and in IE the buttons work but once I click on “close” to close the window, the video closes but the audio continues to play until I refresh the page.

    Anyone have any ideas as to what this might be? The .swf buttons working in IE but not Firefox is very confusing to me. I might also add a page refresh to the “close” button so the page refreshes and the audio stops when viewing in IE.

  145.   #145 Comment Posted by Jeremy on May 3, 12:20 PM

    I forgot to add I am loading the .swf by embedding it into an .html file.

  146.   #146 Comment Posted by Mal Jones on May 3, 05:02 PM

    Rich: I renamed it thickbox.css inside of the css folder at maljones.com

  147.   #147 Comment Posted by Paschal on May 3, 05:11 PM

    Great job for this Thickbox. I use it on a site but I have some issues (same than LightBox). When I click on one of my ThickBox link too quickly after the page appear, the box don’t open, instead a new browser window appears. I believe this is a problem with loading time for the js libraries. But anyone know how to force some kind of script to have a ‘wait until loading finish’ on the page. Check this example to see if you got the same problem http://www.developers.ie/event.aspx?s=46 (click on the Register button on the top right).

  148.   #148 Comment Posted by jon on May 3, 07:15 PM

    holly freaking god…
    i was totally looking for something like this… you, my friend, have saved me a lot of time… thanks so much

  149.   #149 Comment Posted by Rich Schmidt on May 4, 11:19 AM

    Huh. I thought I submitted this comment already…

    Thanks, Mal. For some reason, though, it seems to be working fine without the updated css file. So I think I’ll just leave a good thing alone. :)

  150.   #150 Comment Posted by Kristina on May 4, 01:37 PM

    Happy birthday…Mine was on May 1st!

    I’m having a problem with my styleswitcher (the one using cookies to set a white and a black style) not picking up the new style in the .htm file pulled up via Thickbox. For example, on my website (click my name) there is a “Comments (#)” URL, click that, and note the light style of the thickbox. Then change the style to black (on the upper right) and click the comments link again, still the old style. Even deleting cookies, emptying cache, etc. All to no avail! Safari handles this perfectly, but for some reason this problem crops up in Firefox. Thoughts?

  151.   #151 Comment Posted by dAviDe on May 5, 08:03 AM

    I’ve a problem of auto-centering when the ThickBox is open in IE6 at the bottom of the page.

    Click the link below for the example:
    http://www.sistelsrl.it/networking/net_passivo/accessori-armadio-pavimento.htm
    and click
    “Terminale KVM 19” con monitor 17” LCD, tastiera e touchpad”

    When I click the link, thickbox is open at the top of the page, without auto-centering. Why?

  152.   #152 Comment Posted by Gentle on May 5, 12:05 PM

    Cody: AWESOME job. This is a beautiful piece of work. I hope you had a great birthday.

    I was having the same problem as Ryan (#121) with FF, but his solution works like a charm! I still can’t get the overlay to work in IE though.

    I’m messing with it here: http://gentleproductions.com/test Click on WORK and see how I’ve used it for my t-shirt design portfolio.

    Again, AWESOME job. Thank you so much!

  153.   #153 Comment Posted by Terry Majamaki on May 5, 02:59 PM

    Fantastic script Cody! I love the additional functionality and control over lightbox and greybox! Great job!

    While my Javascript skills are novice at best, I can’t seem to figure out how to fix IE not auto-centering when opening a Thickbox from a link below the fold of a page. Anyone have any luck on this? I’ve tried to see what the Lightbox script does to fix this issue but I can’t seem to get it working in the Thickbox script.

    Thanks again!!!

  154.   #154 Comment Posted by Jordan Drewitt on May 5, 03:15 PM

    Excellent job, Cody! Just a quick note to those of you who also use jQuery elsewhere on their site. It seems that if you use the packed jquery.js (downloadable from jquery.com), there is a glitch in the slideDown of images, where the thickbox momentarily displays all the way to the right hand side of the screen.

    View an example at http://jdrewitt.com/photos/tbox_js_glitch.php

    The quick solution is to use jquery.js from the thickbox example.

    Happy ThickBoxing.

  155.   #155 Comment Posted by Mikael on May 5, 03:51 PM

    Hello. Thanks a lot for a realy handy script. I´ve found a real simple CSS solution for making IE display a fixed div, thus making the thickbox auto-center in an working perfektly in IE to. Follow this url for the solution:
    http://www.cssplay.co.uk/layouts/fixed.html

  156.   #156 Author Comment on May 5, 04:03 PM

    @Mikael – I actually tried this with the example (quickly) and did not get it to work. Do you have a version that works in IE?

  157.   #157 Comment Posted by Mikael on May 5, 04:44 PM

    I also played around a bit with it and at first i didn´t work but now I have a version of the same files as in your download that do. The files are a bit messed up as I did it in a hurry and tried som other stuff to and im sorry for the lack of comments in the code but I´m shore you will figure out the changes I´ve made i the CSS and the index.htm

    preview: http//www.animare.se/thickbox2
    download:
    http://www.animare.se/thickbox2.zip

  158.   #158 Author Comment on May 5, 04:59 PM

    @mikael – Nice work, I see where I made my error. Solution even works in IE 5.5. However, currently you get another set of scroll bars in FF.

  159.   #159 Comment Posted by Mikael on May 5, 05:49 PM

    Hm wierd, i didn´t notice that before. I’m about to implement your fabulous script in my portfolio site and somehow the problem dosn´t apear there. I can’t seem to find a connection as to why i don´t get
    dubble scrollbars there. But then again i am a designer and not much of a coder so i usually use my basic actionscript knowlage and the good ´0l trial and error method. But I’m shore you’ll figure were the catch is.

    http://www.animare.se

  160.   #160 Comment Posted by Mikael on May 6, 06:14 AM

    @Graham Greensall

    change the line 57 in thickbox.js to something like this:
    $(”#TB_window”).append(“”caption“Stäng”);

    then i will display the value of the links title attribute in the thickbox titlebar.

    This is just a basic idea and you´ll have to style to make it look good.

  161.   #161 Comment Posted by Mikael on May 6, 06:20 AM

    Oopps! The whole line wouldn´t display… anyway. add the variable “caption” in the html code for the titlebar in line 57 preferably somewhere before the close-link

  162.   #162 Comment Posted by Jesse on May 6, 07:00 AM

    Awesome! Great work, I love what you’ve done. I’m going to be using it on my site soon to serve as an info box for some things.

    Again, thanks a lot!

    Two questions.. (Im unsure of what type of licensing this is under)

    1. Is there a way to remove the fade effect and just have it go to the shade? I don’t really want the animation, but if its unremovable thats fine.

    2. I cant seem to get rid of the right padding or margin in the CSS. Would you happen to know which ID this is under? I removed the left padding and set it to 0, Id like to do the same for the right but It doesnt seem to have any effect with the margin/padding in every section.

  163.   #163 Comment Posted by Kristina on May 6, 04:19 PM

    Having an issue with the page being loaded not reading cookies. Anyone else have this problem? Across Mac browsers, Safari picks up the cookie no problem, but Camino and FF seem to overlook any javascript call to read cookies. Gecko-based browser problem?

    To be more specific, it won’t pick up 2 types of cookies I have, one to remember contact info on my movable type form, and the other for styleswitcher, remembering a previous stylesheet (white/black).

  164.   #164 Comment Posted by Alexander ,Tung on May 7, 10:51 PM

    Just a suggestion,

    var urlString = /.jpg|.jpeg|.png|.gif|.html|.htm|.php/gi; var urlType = url.match(urlString); urlType = urlType.toString().toLowerCase();
  165.   #165 Comment Posted by Montoya on May 8, 04:13 AM

    I modified Thickbox to resize images that are too large for the viewport. You can see it here: http://www.christianmontoya.com/2006/05/08/thickbox-plus/

  166.   #166 Comment Posted by Montoya on May 8, 04:14 AM

    Oh, I forgot to mention, I hope I correctly honored your copyright. Please let me know if I did anything wrong.

  167.   #167 Author Comment on May 8, 10:06 AM

    @Montoya – Nope, nice work, I have no copyright share and share alike.

  168.   #168 Comment Posted by Loni2Shoes on May 8, 04:15 PM

    Originally posted by John: Played around with the script and example a bit and on IE 6, if you scroll down any and open a thickbox, the box is centered on the original view not the current view. So if someone had a link to a thickbox at the end of a page, the thickbox would load at the top. Whether it was visible or not would depend on how much they scrolled down.

    Is this something you plan to address? Unfortunately, as beautiful as this is, I won’t be able to use it with a “bug” like this one.

  169.   #169 Comment Posted by Dave on May 9, 12:05 AM

    Interesting idea!

    I had testing it, and for some reasons, the effect won’t work.

    The full image i’m linking to from a thumbnail loads up just like usual when it’s pressed. Any ideas?

  170.   #170 Comment Posted by Keith on May 9, 08:34 AM

    I have used Thinbox in http://keith.hostmatrix.org/location.htm, but after seeing this Thickbox, the latter is much better.

  171.   #171 Comment Posted by buda on May 9, 11:00 AM

    var urlString = /.jpg|.jpeg|.png|.gif|.html|.htm|.php/g;
    var urlType = url.match(urlString);

    and

    if(urlType '.htm' || urlType ’.html’ || urlType == ’.php’){//code to show html pages

    Replace this to use ThickBox with php.

    I´ve tested it and it works!!!

    Cody Congratulations for this amazing JS.

    Greetings from Argentina.

  172.   #172 Author Comment on May 9, 12:40 PM

    @buda – Thanks, and glad you commented with the correct change.

  173.   #173 Comment Posted by Gale on May 10, 07:50 AM

    This is a very nice script, but there are some bugs in IE:

    if you click on black transparent div while loading is shown the div is hidden, but the loading is still displayed until the image is loaded in the background

    then when you click on little image again, two big images are displayed.

    and there are some problems with margins in IE with some images (I can’t explain it)

    Still this is a great script and with her I start to use jquery for js scripting on my page

    good work

  174.   #174 Comment Posted by tim0fee on May 10, 09:05 AM

    Wooot!! Thank you Cody for a great piece of work. I know it’s been asked before but can anyone explain how I can load a .swf into the thickbox ?
    lapster mentioned a method calling an iframe but I’m not sure about how to do that.
    thanx again!
    tim0fee

  175.   #175 Comment Posted by Brad Garland on May 10, 10:24 AM

    So would it be possible to do a bit of a mashup and use Veerle’s ‘Flickrness’ section and still use the thickbox for previewing?

  176.   #176 Comment Posted by JohnB on May 10, 04:27 PM

    Hi,

    Great work cody! Just in case anyone else was struggling with this; When loading html content containing an image into the ‘thickbox’, the image appeared with a border that looks odd with some images. Easy fix, – in the global.css, look for the ’#TB_window img’ class and remove the border attributes. The image then loads into the thickbox looking nice ‘n’ clean..

    Easy!

  177.   #177 Comment Posted by Graham Greensall on May 11, 03:01 AM

    @Mikael
    Thanks for the suggestions #160/161 re titles – much appreciated

    @Cody
    Hope you had a great birthday – 30 seems veerrry young from my perspective :) Thanks again for sharing Thickbox – great piece of work.

  178.   #178 Comment Posted by tim0fee on May 11, 06:28 AM

    re #174

    I figured it now ;-) which was probably better than someone telling me how to anyway!!

    Thanks again for a great tool Cody.

    tim0fee

  179.   #179 Comment Posted by finnagin bell on May 11, 07:39 AM

    Hi all. I am rookie hack who is a bit stuck incorporating this into a website. I have used lightbox successfully (and easilly) but can’t get my thinkbox to function. Do i need to do anything different than what I would to get lightbox to function (include the script types and a link rel in the header, and duplicate the examples from your website) ???

  180.   #180 Comment Posted by Dan Atkinson on May 11, 08:16 AM

    @Buda
    There appears to be a few issues with the changes you made to the script.

    One of them is that you don’t actually check for HTML or HTM pages (urlType ’.htm’ isn’t a valid check). Also, the single quotes you use may have been copied incorrectly. The problem with this is that pasted across to a text editor like wordpad, which will accept different styles of quotes, they won’t work. IE, the difference between ’ and ’.

    My suggestion would be to use the following code.

    var urlString = /\.jpg|\.jpeg|\.png|\.gif|\.html|\.htm|\.php/g;
    var urlType = url.toLowerCase().match(urlString);

    and

    if(urlType '.htm' || urlType ’.html’ || urlType == ’.php’){

    This works correctly and also lowers the case of the extension to prevent problems which causes problems (IE, .JPG to .jpg).

    P.S. Please can you make the comment box a little bigger? It’s ridiculously small!

  181.   #181 Comment Posted by Dan Atkinson on May 11, 08:34 AM

    No, it seems that it’s the site which has a problem with different styles of quotes and double-equals (==).

    Apologies.

  182.   #182 Comment Posted by Montoya on May 11, 12:12 PM

    Cody: I noticed that the version of jQuery you included with the Thickbox demonstration is not compressed. Would it work fine with a compressed version?

  183.   #183 Author Comment on May 11, 12:16 PM

    @Montoya – Yes, but not in safari currently. Or I should say my version of safari (2.0 (214)). This is the only browser that does not like the compressed version that I am aware of.

  184.   #184 Comment Posted by Montoya on May 11, 01:53 PM

    That’s interesting, thanks for letting me know.

    I should mention that I updated Thickbox Plus. The link is the same: http://www.christianmontoya.com/2006/05/08/thickbox-plus/

  185.   #185 Author Comment on May 11, 02:34 PM

    @Montoya – Again, nice work. I’ll have to play catch soon. If possible, send me a link to the implementation when you are done.

  186.   #186 Comment Posted by Dale on May 11, 07:43 PM

    First off, well done on the script.

    I’d love for you to add the feature from lightbox where you can create a set of “boxes” using the syntax class=”thickbox[setname]”

    That would allow me to show a series of related information in an easy way.

    Excellent script, keep up the good work!

    Dale

  187.   #187 Comment Posted by truxie on May 11, 09:23 PM

    is there any quick fix for the following problem? its really annoying and prevent me to use such a great tool. please someone give me a good news!!
    —————————
    Comment Posted by Loni2Shoes on May 8, 03:15 PM
    Originally posted by John: Played around with the script and example a bit and on IE 6, if you scroll down any and open a thickbox, the box is centered on the original view not the current view. So if someone had a link to a thickbox at the end of a page, the thickbox would load at the top. Whether it was visible or not would depend on how much they scrolled down.

    Is this something you plan to address? Unfortunately, as beautiful as this is, I won’t be able to use it with a “bug” like this one.

  188.   #188 Comment Posted by jakob on May 12, 07:55 AM

    Is it in some way possible to print the content of the box that appears? The normal print function (in firefox) ignores it as it is outside the regular page source but perhaps it’s possible to specifically print the box itself by adressing it specifically using JS? A “print” button (preferably optional) next to the close button would work very well. Any suggestions as to whether this is possible and what code would be necessary.

  189.   #189 Comment Posted by Gavin on May 12, 10:52 AM

    Hi there,

    Is there a piece of code within the CSS or JS that I can tweak so that I can change the HTML background transparency of the thickbox underneath the content. Not the main background with transparency already, that covers the whole page once the thickbox has loaded.

    Cheers.

    Cheers

  190.   #190 Comment Posted by Amit on May 12, 01:30 PM

    instead of having the user to click on the link to show “thickbox” how can I show the thickbox as soon as the page loads?

  191.   #191 Comment Posted by jakob on May 12, 01:40 PM

    Gavin, you can also apply transparency to other elements. You’ll see 3 lines in global.css in #TB_overlay. You can copy these to #TB_window for example and adjust the settings as you want them, e.g. opacity=90 or 0.9 to slightly reduce the opacity of the thickbox to allow the background to slightly shimmer through.

  192.   #192 Comment Posted by kevin on May 12, 05:12 PM

    Anyone figure out how to use this with a “Ruby on Rails” link_to? I’ve tried many different ways and it seems to always get stuck at the loading graphic. Pointing to a .htm file in /public works but that kinda defeats the purpose of using rails.

  193.   #193 Comment Posted by finnagin bell on May 13, 06:31 AM

    || THINKBOX INSIDE THINKBOX?? ||

    Is it possible to launch thinkbox via a html file that includes thinkbox???

    I have thinkbox working fine in html#1, so now I wish to launch html#1 from html#2 by ways of Thinkbox. It is launching, but less some page content and script function. Could this be JS conflict, or have I just source= incorrectly in my tired state of mind?

  194.   #194 Comment Posted by finnagin bell on May 13, 08:42 AM

    // ERROR IN previous post //

    html#1 is LIGHTBOXED, and I am trying to lauch that through html#2 which is THINKBOXED. Is this possible?

    If so, will Lightbox run inside Thinkbox ???

  195.   #195 Comment Posted by Darcy on May 14, 12:10 PM

    Thanks for this beautiful code. I don’t know how you guys come up with this stuff…

    See it in action:
    http://www.pingpongmusic.net

  196.   #196 Comment Posted by Gale on May 14, 05:17 PM

    Can I do image transition every x seconds with thickbox?

    thank you

  197.   #197 Comment Posted by Anthony on May 14, 08:02 PM

    Can’t seem to get Quicktime properly embedded and playing within a Thickbox in Firefox or Opera. Working just fine in IE and Safari. Anyone have any tips to share?

  198.   #198 Comment Posted by Dan Atkinson on May 15, 06:44 AM

    @Gale: I’m sure you can.

  199.   #199 Comment Posted by Gale on May 15, 10:37 AM

    @Dan Atkinson: is there any example ?

  200.   #200 Comment Posted by Gavin on May 15, 12:08 PM

    This kinda works but it makes everything have transparency within the TB_window. I’m after just the background being transparent, not the content loaded in.

    Cheers for your help so far.

    RE: Gavin, you can also apply transparency to other elements. You’ll see 3 lines in global.css in #TB_overlay. You can copy these to #TB_window for example and adjust the settings as you want them, e.g. opacity=90 or 0.9 to slightly reduce the opacity of the thickbox to allow the background to slightly shimmer through.

  201.   #201 Comment Posted by Rob Greer on May 15, 06:45 PM

    This is some really great work. I already plan to deploy this script to handle a function on the gallery portion of my site. However, like others who’ve posted before me, I’m plagued by the IE problem that keeps the thickbox window above the “fold” when position a link deeper on any page. You mentioned that you’ll fix that problem in the next update. May I ask you to share your best guess as to an ETA for your next release?

  202.   #202 Comment Posted by Alyosha on May 16, 01:24 AM

    How hard would it be to darken only a single div in an existing window, and have the thickbox inset window automatically center within that div wherever it may be on the page? Essentially to make the thickbox apply to a div rather than the body of the parent window? Is there a straightforward mod I can do to make this happen?

    Thanks, I love the code!

  203.   #203 Comment Posted by Gale on May 16, 11:59 AM

    W hat modification to the code has to be done, that loading image is shown and not loading animation?

  204.   #204 Comment Posted by Joel Holder on May 17, 11:45 AM

    Hi –

    I was wondering if there is some trick that I’m missing. Following the example

    This opens the .aspx target page, but no dhtml effect. I am using a masterpage. I’ve tried linking:

    global.css

    jquery.js

    and

    thickbox.js

    This opens the Items.aspx page, but no dhtml effect. I am using a masterpage. I’ve tried linking:

    I think that the javascripts and css are not being properly included because of the html header section is in the masterpage, not the derived page that I am trying to get the thickbox behavior in. I’ve even tried to programmatically include these files at runtime in my Page_Init(). Have a look:

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init

    Link3.Href = “Effects/thickbox/css/global.css”

    Link3.Attributes.Add(“rel”, “Stylesheet”)

    Link3.Attributes.Add(“type”, “text/css”)

    Page.Header.Controls.Add(Link3)

    Dim Link1 As HtmlLink = New HtmlLink

    Link1.Href = “Effects/thickbox/js/jquery.js”

    Link1.Attributes.Add(“language”, “JavaScript”)

    Link1.Attributes.Add(“type”, “text/JavaScript”)

    Page.Header.Controls.Add(Link1)

    Dim Link2 As HtmlLink = New HtmlLink

    Link2.Href = “Effects/thickbox/js/thickbox.js”

    Link2.Attributes.Add(“language”, “JavaScript”)

    Link2.Attributes.Add(“type”, “text/JavaScript”)

    Page.Header.Controls.Add(Link2)

    End Sub

    The javascripts and the css do show up in the html source. I’m just a bit confused. Wonder if you have any insight from your apparent success.

  205.   #205 Comment Posted by Joel Holder on May 17, 02:58 PM

    This post addresses my previous. Disregard. My own lameness was to blame. When debugging in VS2005 (using Cassini), the IDE inserts the project name in the URI. Was assuming a normal path when calling in the javascripts. Works great! This code rules, Cody!

  206.   #206 Comment Posted by 84 on May 17, 11:52 PM

    @ post #79 – I have forms working beautifully on my thickbox. eventually going to move from .htm to .php on those pages since I like all of my pages to be php, but that’s for later.

    I am having a bug experience in Firefox (gasp!)....I checked on a windows computer with a much higher resolution than I design for/on, and the overlay only covers 100% of the content, not 100% of the window. So when my coding ends, the overlay ends, leaving a chunk of white space below it. Any way to fix the 100% from the code to the window on this bug? I can give a screenshot if need be.

    Thanks again for the great code, I’ve gotten lots of compliments on the implementation of it and intend to give you credit on my ‘about’ page. Thanks again for anyone who can respond about this quirky FF bug. (might also just be a CSS problem so feel free to check out the code for that)

    http://www.eightyfour.net

  207.   #207 Comment Posted by Xevor on May 18, 01:39 AM

    This won’t work for me unless I remove prototype AND moo.fx from my page! Any suggestions to fix?

  208.   #208 Comment Posted by Peter on May 18, 03:11 AM

    Hi
    How can i use background-image thickbox?
    I don’t wanna use overlay

    Thank’s

  209.   #209 Comment Posted by sebastian on May 18, 08:45 PM

    Hey very nice work, but i need help, i call a page via ajax, and in this page have an image, but thinkbox dont work, i think maybe is beacuse the script dont parse this “new” image how i can do to call again the script?

    Sorry for my bad english

  210.   #210 Author Comment on May 19, 12:19 AM

    FYI – A ThickBox update is coming soon.

  211.   #211 Comment Posted by Mike on May 20, 01:12 PM

    Oh good stuff! An update!
    Thanks, this is a great resource!

  212.   #212 Comment Posted by yusufdestina on May 21, 01:16 PM

    seems there is a problem when using link set by innerHTML:
    document.getElementById(‘div_link’).innerHTML = ...

  213.   #213 Comment Posted by Joe on May 22, 05:20 AM

    It seems that it doesn’t work with asp drop down lists (.net 1.1). The drop down list remains available. Any idea how to get around this?

  214.   #214 Comment Posted by Jose Manuel on May 22, 12:23 PM

    Hi. This is great. The only thing is that sometimes it´s not working for me, when I´m putting the links to the images in the middle of a page with a load of content, inside several divs.

    Instead of working it follows the link as a normal image url, but if I move the same link to the top of the page it works. Weird, isn´t it?

    That is happening on FF 1.5.0.3, the same page on IE 6.0.2 it´s working. Any help?

  215.   #215 Comment Posted by tan doan on May 22, 04:30 PM

    Hi Cody, I think thickbox is great, but I have a little problem.

    I took your demo, and included the latest version of prototype before jquery and thickbox, and it breaks in win xp FF 1.5.0.3

    Here’s a link to the error:
    http://ihasolutions.com/thickbox_error.jpg

    Since I haven’t done that much coding in my app yet, I’ll probably remove prototype, as nice as it is.

  216.   #216 Comment Posted by fred M on May 23, 06:14 AM

    Nice code, works like a dream in FF-1.5.
    Unfortunately it kind of crashes in IE-6.0, either before it shows the picture-box or when I try to close it.

    Look here: nikolai.overdalsveien.com/

    If someone has an idea, I’m interested.
    It doesn’t look like it’s the CSS, but rather something in JS, which unfortunately is waaaay beyond me…

    Tnx
    \fredM

  217.   #217 Comment Posted by minda on May 23, 08:20 AM

    wow!!!! this is really cool!
    Its very easy to use once you understand how to apply it, I am quite a novice at web design.

    If you would like to make this more user friendly to all of us novices out there I would suggest to give a 1. 2. 3. instructions.. including when and how to download and unzip file.

    I tried lightbox out right before finding thickbox, and your right, download times are soo much faster! Love the functionality, and text option!!!

  218.   #218 Comment Posted by Thomas on May 24, 05:15 AM

    Is it possible to override javascript alert and confirm with thickbox? Is there a way to do this?
    Thanks,
    Thomas

  219.   #219 Comment Posted by Hans on May 25, 09:09 AM

    I’m having problems when using thickbox together with DWR. When I remove the jquery.js file, everything works fine again, except thickbox of course. Is there any one having the same problem and found a solution for it?

    @Marcel Panse: I’ve noticed your comment (#71) and it seems you’re having the same problem. Did you manage to get it working already?

  220.   #220 Comment Posted by Lorenzo on May 27, 03:57 PM

    Fine, but if I must use tag html in the box?(table, tr,td and other?)

  221.   #221 Comment Posted by Viddo on May 28, 07:43 AM

    This is great, you really saved my day! Tried both Lightbox2 and “Lightbox goes wild” but wasn’t really satisfied with the result. This, on the other hand, works like a charm! Once again, thanks.

    Keep up the work!

  222.   #222 Comment Posted by X on May 28, 07:59 PM

    All of this is just a bite from SubModal!

    Try out the original…

  223.   #223 Comment Posted by Andrey Skvortsov on May 30, 06:34 AM

    What if I already have html page to display?
    How I can use html text instead of url to show?

    Thanks.

  224.   #224 Comment Posted by wwwdeveloper on May 30, 10:42 AM

    Anyone have any ideas for making this work on an image map? I am succesfully using the thickbox on various parts of other websites, but I am having trouble getting it to work on an image map:

  225.   #225 Comment Posted by Jordan on May 30, 02:03 PM

    i think you should add flash support (.swf files) so we dont have to have the swf in another page (i have an idea on how to do this)

  226.   #226 Comment Posted by Morten on May 31, 06:03 AM

    I think this is pretty great. Personal i hate javascript, so I’m glad someone else is doing the hard work… :)

    On problem though, in the regexp math. If I’m linking an .aspx file, it matches the .asp extension.

    But besides that (it works fine anyway) this is cool. Good job

  227.   #227 Comment Posted by Harry on Jun 1, 01:06 PM

    I’m getting some strange behavior with images and HTML. For images, the thumbnail is displaying below the large image in the modal window. For HTML, in this case an object tag (for Flash), the modal window fits perfectly in Safari but has scrollbars in IE6 and Firefox.

    Also, in IE6, the Flash movie continues to play even after the modal window is closed.

    And, in IE7 the link to HTML content goes to the HTML page instead of loading the modal window.

    See http://harrylove.org/2006/05/09/harry-discusses-the-new-domain-name

  228.   #228 Comment Posted by Dave Simon on Jun 1, 07:47 PM

    This worked great for me, I love the extra control it gives over the size and position of the Thickbox.

    One thing I’d really like to see added is the ability to have the Thickbox be a div set to display:none in the HTML.

    I’d like to use this for a contact form and really would rather the form be a part of the HTML in the page for accessibility.

  229.   #229 Comment Posted by anshul on Jun 2, 12:59 PM

    I am on Firefox 1.5.4 and the bottom lare image doesnt look right with screen resolution at 1200×1024

    Thought I did just let you know…

  230.   #230 Comment Posted by Thomas on Jun 3, 09:06 AM

    great script will put it to good use in some of my projects. Thanks for you work!

  231.   #231 Comment Posted by Linus on Jun 4, 12:25 PM

    Hi. I´m new to this…when mouseover the thickbox, I can se the code for “title”. Don´t want that. What to do? Thnks a lot

  232.   #232 Comment Posted by Andrew on Jun 5, 11:33 AM

    Just fyi, a couple of bugs reported over at jQuery blog: http://jquery.com/blog/2006/04/24/thickbox/#comment-474

  233.   #233 Comment Posted by Lautreamont on Jun 5, 06:27 PM

    Great!!!!! I think I will use it on my site.

    Thanks, man. =]

  234.   #234 Comment Posted by Stuart on Jun 8, 06:11 AM

    Does anyone know if there is a way of solving the following problem: When viewed in IE all Flash objects in the page are displayed on top of my thickBox pop up. I want the popUp to be at the top level (above flash objects)

    Thanks

  235.   #235 Comment Posted by serge on Jun 9, 07:41 AM

    Hi,
    I want to use TB to display a HTML file with an image-map and tooltips appearing on several areas. Unfortunaly when the HTML is displayed the tooltips doesn’t function. I’m using the Interface plug’in (for JQUERY)for the tooltips. Is there a solution? Thanks

  236.   #236 Comment Posted by Chris on Jun 16, 12:05 PM

    Just wanted to let you know of a little work around I created. If you want to use TB on a page with windowed elements (such as select boxes) in IE- you need to add another layer behind the overlay to cover up the windowed elements otherwise they will show through the overlay and the dialogue box. The solution I found is to create an iframe with a z-index immediately bihind the overlay layer and set the iframe’s width=100% height=100% and alpha (or opacity for FF) to 0. Thanks for the great code.

    -c

  237.   #237 Author Comment on Jun 16, 12:19 PM

    @Chris – Clever, I like it…thanks for posting this work around.

  238.   #238 Comment Posted by Rasmus on Jun 17, 09:36 AM

    Can ThickBox be used in conjunction with a livesearch-like function, so that the contents are dynamically updated via a xmlhttprequest??

  239.   #239 Comment Posted by Rob Hawkes on Jun 18, 07:00 AM

    Great modification. Is it still under the Creative Commons Usage Agreement that the original Lightbox was under?

  240.   #240 Comment Posted by Rob Hawkes on Jun 18, 12:17 PM

    Apologies i think i got the impression this was a modification of lightbox. Anyway my question still remains, what is the license agreement for this script?

  241.   #241 Comment Posted by Eli on Jun 18, 11:36 PM

    How do I install this?

  242.   #242 Comment Posted by carlos on Jun 19, 02:38 AM

    thanks so much. it’s just what i wanted but didn’t want to spend the time figuring out by hand just now (!).

  243.   #243 Comment Posted by Fausto G Pacheco on Jun 19, 09:15 AM

    Great work,

    when I load and html file embeded whit some flash content, the flash does not appear, what is the fixe?

  244.   #244 Comment Posted by Fausto G Pacheco on Jun 19, 09:40 AM

    An i forgot one question, I´m trying to use TB inside you AHAH code and dosen´t work, it opens the image in another page, is this a conflit of code, I trie too whit ajax tabs from dynamic drive and the error is the same.

    regards

  245.   #245 Comment Posted by g0nzo on Jun 21, 08:35 AM

    Hi!
    Just a question regarding select inputs in ie and Chris’ iframe workaround.

    I’ve added an empty iframe to the $(“body”).append function.

    CSS style for this iframe is exactly the same as for the overlay except all 3 opacities are set to 0 and z-index is 99.

    However select inputs are still visible. Am i doing something wrong? Any ideas?

  246.   #246 Comment Posted by prisme on Jun 21, 10:52 AM

    do you test if the css is loaded in your js ?

    if so, that’s a very good idea, but maybe you should make an installation manual for dummies like me O:)

  247.   #247 Comment Posted by Eli on Jun 21, 10:18 PM

    How do I install this? :(

  248.   #248 Comment Posted by Murlyn on Jun 22, 02:32 AM

    I second the request for lightbox 2 “groups” forward and back through images plus the ability to open a box, then open another box from the original box.

  249.   #249 Comment Posted by Daniel on Jun 23, 05:58 AM

    I got the same problem with jquery and dwr as Marcel (#71) and Hans (#219)

    @Marcel and @Hans – anybody has a solution, most welcome…

    I am using the compressed version of jquery.

  250.   #250 Comment Posted by RicoD on Jun 23, 07:32 AM

    Just wanted to thank you for the thickbox, great utilisation of jquery!

  251.   #251 Comment Posted by Peterbix on Jun 23, 12:32 PM

    I have a problem when displaying a html file in IE. Form some reason the ul is not displaying correctly. My style sheet, linked or embedded, has: ul {list-style-type:none;} li {list-style-type:none;} but it displays the lists with bullets. They also have a bottom margin of 10px that does nothing! The a and a:hover attributes are working fine. Any suggestions?

  252.   #252 Comment Posted by Lautreamont on Jun 24, 11:54 AM

    This is just wonderful man, very classy!!!!

    :o)

  253.   #253 Comment Posted by Nilesh on Jun 25, 01:59 AM

    Nice! just that, nice! hehe

  254.   #254 Comment Posted by ccdust on Jun 25, 02:23 AM

    Does anybody figured out how to display flash inside thickbox?

  255.   #255 Comment Posted by tom on Jun 27, 04:27 AM

    Anyone figured out how to overlay flash-elements?
    Once the pop-up appears, the flash objects don’t grey out like the rest of the screen…any ideas?

  256.   #256 Comment Posted by Ricky on Jun 27, 04:45 AM

    Anyone has experimented problems with cache?I mean, you have to reload two times the page for thickbox works fine.

  257.   #257 Comment Posted by tom on Jun 27, 05:49 AM

    found it out:
    To have the box overlay your flash animation simply set wmode to transparent before exporting it (or add to your html code)
    found it on your “update” page, thanks to “faitesvousunnom”!
    read more about it here:
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_15523

  258.   #258 Comment Posted by mrrena on Jun 27, 04:23 PM

    ThickBox offers some really useful additions to both Greybox and Lightbox. However, it still does not support inline divs, the one thing that stops me from implementing it. If you want a newer alternative that does just that (and quite a few other things besides), see Ahmed’s IBox: http://www.ibegin.com/blog/p_ibox.html.

  259.   #259 Author Comment on Jun 28, 09:51 AM

    @mrrena & Everyone – Inline div functionality has been added to ThickBox. You’ll see it in the next release.

  260.   #260 Comment Posted by mrrena on Jun 28, 05:34 PM

    That sounds great—thanks!

  261.   #261 Comment Posted by Andy Opel on Jun 29, 03:31 AM

    I am running thickbox on a page that also has flash files playing on the page. When I click to display a large image the the flash appears over the top of my enlarged thickbox image.

    I have tried using z-index’s in the CSS to move flash layers underneath the thickbox image but it didnt work. Can anyone suggest how I get the thickbox image to appear OVER my page and the flash files?

    thanks

  262.   #262 Comment Posted by Andy Opel on Jun 29, 03:34 AM

    oops never saw the post above

  263.   #263 Comment Posted by grezman on Jun 29, 03:44 AM

    great work. i hope it works with .php files

  264.   #264 Comment Posted by Nothing on Jun 29, 10:04 AM

    Please me help. IE input select is not below photo windows. z-index no accept.

  265.   #265 Comment Posted by Jon on Jun 29, 02:44 PM

    Can this be modded to recognize PDFs? Considering you can view PDFs within FF and IE would be great to throw into thickbox with the loader.

  266.   #266 Comment Posted by Griff on Jul 2, 11:06 AM

    Will this work on a Div Overlay on myspace..?

  267.   #267 Comment Posted by Ryan on Jul 3, 02:39 PM

    Can anyone tell me how I can have the JS load before all the images load?

    My problem is I have lots of thumbnails, if someone clicks the thumbnail before they all load they get taken to a blank page with the image as the JS doesn’t have time to kick in.

    :(

  268.   #268 Comment Posted by Sid Upadhyay on Jul 3, 10:18 PM

    @ Everyone that would like to make their own close link.

    Try this, onclick=”TB_remove();”. Add that into the link.

    PS. Great script!

  269.   #269 Comment Posted by Paul on Jul 4, 08:42 PM

    Cody, have you considered adding a “is css enabled/working?” check in the js? With css disabled the script should not get run. Currently it does, with pretty bad results …

    Just a thought.

    Thanks for all the time and effort put into this. It’s appreciated.

  270.   #270 Comment Posted by Andy Rambling on Jul 5, 06:16 AM

    Just curious, what is the main reason for using Class=”thickbox” against using what would be recognised as a better method being REL=”thickbox”

    Would a future release have this option?

    TIA.

    Andy

  271.   #271 Comment Posted by Zond on Jul 6, 04:24 AM

    I also would like a way for this to work in Ruby on Rails. I have tried some ugly hacks, like removing the type-matching and just allways going for html content, but still it gets stuck at the loading graphics without any errors in the js console…

  272.   #272 Comment Posted by diego on Jul 6, 10:46 AM

    When I click on one of my ThickBox link too quickly after the page appear, the box don’t open, instead a new browser window appears. I believe this is a problem with loading time for the js libraries. But anyone know how to force some kind of script to have a ‘wait until loading finish’ on the page.
    this issue only happens in FF for mac and PC

    thanks

  273.   #273 Comment Posted by LouBBOS on Jul 6, 01:10 PM

    Getting ”$ is not defined” error from thickbox.js
    also is there a way to keep the div active it a user clicks the grayed out area?

  274.   #274 Author Comment on Jul 7, 09:31 AM

    @LouBBOS – Not sure why you are seeing the js error. I don’t see that on my end. As for the click on the overlay…just remove this code: $(”#TB_overlay”).click(TB_remove);

  275.   #275 Comment Posted by Jane on Jul 7, 11:19 AM

    I can’t get this to work with a php file. Is that right or is it just me?

  276.   #276 Comment Posted by gonssal on Jul 7, 11:46 AM

    And what about LightBox’s functionality allowing to group related images?

  277.   #277 Comment Posted by gaggle on Jul 7, 03:54 PM

    #272 Comment Posted by diego

    I’m getting the exact same error on my site as diego in #272. I can’t get it to happen on the example page though, so maybe this bug only appears on more complicated pages?

    Terrif script though Cody, it’s very cool and very nice, and I just hope you can reproduce the error yourself.

  278.   #278 Author Comment on Jul 8, 08:49 AM

    @Gonssal – Its coming…

    @Jane – If you look at the demo, the link to a Thickbox with no scrolling content is calling a php file.

    @diego – Are you using the new version of jquery?

  279.   #279 Comment Posted by JL on Jul 10, 09:20 PM

    I also have this problem of inputs displayed over the image in IE!

    I would use thickbox if it wasn’t of this problem.

    Thanks for the help!

  280.   #280 Comment Posted by Rob McM on Jul 11, 04:25 AM

    This is great, and a lot handier than the standard lightbox!

  281.   #281 Comment Posted by KansasFiddler on Jul 11, 08:40 AM

    Downright sexy!

  282.   #282 Comment Posted by Robert on Jul 11, 09:41 AM

    Really cool, though I’d really like to see the option to stay in the ThickBox when you click a link or do a form post.

    Also, can you call the ThickBox via a form post in the parent window? It would be nice if I can pass parameters to that window via hidden fields instead of a query string through a regular link.

    Thanks!

  283.   #283 Comment Posted by Rachel on Jul 11, 10:55 PM

    Hi, this is awesome!

    Only thing is, is there a way to avoid conflicting styles without re-doing all my stylesheets? The html page I am linking to has to have styles but they are conflicting with the parent page styles.

  284.   #284 Comment Posted by Giacomo on Jul 12, 02:28 AM

    Great Work!
    I am interested to know how I can pass parameter at the new window: how I can do that?

  285.   #285 Comment Posted by wouter on Jul 12, 08:25 AM

    Can you put the thickbox on a swf ???

  286.   #286 Comment Posted by Xavier Pimienta on Jul 12, 11:21 AM

    Hello, I think that is very great code!! Although I have a problem: I am spanish and the pages that I show in thickbox has accents and other signs: when I show it inside thickbox, instead of this accentuated letters, it shows interrogation sign (?). Do you know how can I solve it? Thanks a lot!!!

  287.   #287 Comment Posted by Darrell Smith on Jul 12, 03:17 PM

    It doesn’t work with Konqueror. When I tried it with Mozilla it did of course but I believe overLIB is a more flexible tool. http://www.bosrup.com/web/overlib/

  288.   #288 Comment Posted by Stephen Halsey on Jul 12, 11:55 PM

    Hi Cody,

    FYI, there are 2 #TB_load selectors in the style sheet included with the downloadable example. Great work with all of this.
    -Stephen

  289.   #289 Author Comment on Jul 13, 09:29 AM

    @Stephen Halsey – Thank you, and nice catch.

  290.   #290 Comment Posted by Jennifer on Jul 13, 02:53 PM

    Thanks for all your good work for this script. I’m putting it to use in a Plog I’m building.

    It works perfectly in IE but in Firefox, there’s a flicker on display, and my pngs won’t load unless they are already in the browser’s cache.

    http://www.kdpublish.com/artwork/index.php?level=album&id=1&page=6

  291.   #291 Comment Posted by Matt Allen on Jul 13, 03:11 PM

    Hi Cody,
    Great work on ThickBox. I am loving the ease of use.
    I am by no means an expert with scripts so this type of thing is wonderful to be able to access.
    I am having a hard time getting external sites to open in the ThickBox however. I was able to get a relative link to open. I get the dreaded white box & red X.

    Thanx for your advise…

  292.   #292 Comment Posted by JL on Jul 13, 06:47 PM

    Jennifer (#290),

    I had the same problem with Firefox that flikers. I’d say try the last version of jquery instead of the one provided with thickbox (but I got a new bug with the latest!) or try this:

    Change, in jquery.js:
    ———————
    // Get the current size
    z.cur = function(){
    return parseFloat( jQuery.css(z.el,prop) );
    };
    ———————-

    for
    ——————-

    // Get the current size
    z.cur = function(){
    z.el.style.visibility = “hidden” ;
    var res = parseFloat( jQuery.css(z.el,prop) );
    z.el.style.visibility = “visible” ;
    return res ;
    };
    ——————-

    Use this at your own risk! But it seems to work for me! Hope this help.

  293.   #293 Comment Posted by Jim P. on Jul 14, 05:28 AM

    Great job. This is awesome. One thing I can’t nail down yet. Is there a way to just use onClick to call thickbox? Thanks.

  294.   #294 Comment Posted by James Pierce on Jul 15, 10:05 AM

    First, great work. I love it.

    Second, when linking to another directory, Thickbox doesn’t seem to work. For example, I have a file with the script in the root directory but if I link to an HTML file at video/whatever.html it doesn’t load. (Safari gives a question mark for the embeded quicktime file and FF goes straight to the html file, not in thickbox but the QT file works) If I move the whatever.html file to the same directory as other file (in this example the root directory) everything works fine.

    Is there a way to fix this?

    Also, in Safari, the audio from embedded quicktime files do not stop playing after closing thickbox.

  295.   #295 Comment Posted by James on Jul 15, 12:15 PM

    Interesting concept, but if I could give a friendly critique, the transitions are very choppy. It was like trying to a view an animation at 15 fps versus 31 fps. I’m not sure if that’s an issue with this script itself, or simply the examples provided.

  296.   #296 Comment Posted by James Pierce on Jul 15, 12:23 PM

    I might have solved my previous problem (minus Safari still playing the audio) but now it just sticks on the loading screen. Even when I use the example from your site uploaded straight to my server.

    my two problems are found at
    http://www.jpegjames.com/thickboxtest.html
    &
    http://www.jpegjames.com/thickbox-2/

    (the second one being the example from this site)

    Is there something with my server that I need to set???

  297.   #297 Comment Posted by JohnNewton on Jul 15, 03:04 PM

    Excellent work! I like the inline DIV portion. I use it for displaying announcments on my site. I’m not all that swif with JS and maybe I’ve missed something, but, how do I stop the text from being centered in TB?

    Thanks

  298.   #298 Comment Posted by JohnNewton on Jul 15, 03:20 PM

    Disregard the last psot – my bad. Checked my CSS and found the culprit.

    Any idea when the lightbox look-alike slide show will be avaialble?

  299.   #299 Author Comment on Jul 17, 07:53 AM

    @John Newton – Soon, very soon. I have a working version.

  300.   #300 Comment Posted by Baba on Jul 17, 03:40 PM

    Great job, but I’ve a problem with the italian letters like “à ò è é ì”, when I show them I don’t see the letters but ’?’ .
    Where is the problem?
    thanks a lot

  301.   #301 Comment Posted by Daniel on Jul 18, 02:24 AM

    Hi!

    This is a wonderful script. I want to use it on my site, but it contains a frame. In the frame I have a gallery, but I want to apply the script to the whole screen. Can somebody help me ?

    Thanks!
    Daniel

  302.   #302 Comment Posted by Ian Oxley on Jul 18, 06:31 AM

    The examples look really impressive, however I think I might have found a bug: when I include a link in a page such as:

    [a href=”test.htm?height=150&width=300]Test[/a]

    And ‘test.htm’ contains the only following:

    [p]Hello World![/p]

    I get a page that places the contents of ‘test.htm’ and the bottom of the page but infinitely increases in height when you try and scroll to the bottom of the page!

    Thanks

    Ian

  303.   #303 Comment Posted by Oliver on Jul 18, 06:58 AM

    Great Work!!! I added the slideshow functionality:

    http://www.thespotskate.it/galleria.asp

    With a simple script based on Jquery and Ajax calls I replace dinamically the html of divs. If someone is interested ask me. Only one issue, sometimes lightbox doesn’t fire when I click on links… Any solution?

  304.   #304 Comment Posted by perko on Jul 18, 10:40 AM

    Hello, how i can set when page is load, to open pop-up window with image with thickbox. Thanks.

  305.   #305 Comment Posted by frozentech on Jul 19, 04:25 AM

    help me… here my senario.. the link is inside a i frame. when i click on the link i want the thick box to be shown on the top window.. how can i accomplish this??? thanks in advance

  306.   #306 Author Comment on Jul 19, 07:13 AM

    @Perko – you can call the thickbox function TB_show onload.

  307.   #307 Comment Posted by Blaine Garrett on Jul 19, 12:32 PM

    Great little alternative to lightbox. Any chance of just loading a div into the thickbox or even JS to dynamically write the div? I am doing a bunch of CMS dev and do not really want to load external HTML files. In the end I am loading a Flash file that loads an image.

  308.   #308 Comment Posted by Blaine Garrett on Jul 19, 01:42 PM

    Nevermind. I see this works in the release. Great job guys. What is the license for this? Do ya’ll accept donations?

  309.   #309 Comment Posted by gonssal on Jul 19, 03:20 PM

    For those having problems when displaying thickbox in Firefox: the iframe created to hide selects in IE is what makes it fail (or at least it stopped failing when i removed it). If you have no select tags in your page (or even if you have), delete the iframe tags in the $(“body”).append() method in TB_show function.

    Cody, i’d like to know if you are working on the slideshow implementantion (and releasing it soon) or should i write it.

  310.   #310 Comment Posted by gonssal on Jul 19, 06:27 PM

    Sorry for double comment, but needless to say, if you need help implementing the slideshow thing, send me an email.

  311.   #311 Comment Posted by chris on Jul 21, 01:54 PM

    I tried the fix by gonssal and it ‘kind of’ works. What I’ve noticed is that when the image to be loaded is already in the cache, it always works. But if I clear my cache it hangs up.

    Tried the fix above, and now the first time I click an image after clearing my cache, it hangs up. I abort and then click again and viola!

    Then there is the wierdness of the link sometimes acting like it doesn’t have the ‘thickbox’ class assigned to it. I noticed that when my page hasn’t completely loaded then I get that behavior, if I wait a sec, til the whole thing is up, then it works like a charm.

    I’ve duplicated the first weirdness on your demo page.

    Hope this helps!

  312.   #312 Comment Posted by David Dixon on Jul 22, 07:27 PM

    Firstly, great functionality you have here cody. I typically work with prototype… but thats an easy fix with a little code reworking :), and i tend to avoid Scriptaculous as i feel its too bulky for minor functionality (at least with general projects), so I like the smaller animation substitute you use here.

    I have just noticed a minor bug though with Firefox 1.5 / Opera 9 (with the biggest problem in Opera 9).

    There doesnt seem to be any measure in place for the “less-savvy” internet users who double click. In IE6, the problem doesnt “appear” there (but that could just be luck me not noticing it). In FF though double clicking opens a closes the overlay instantly, whereas Opera seems to want to launch 2 versions, which then never close properly without a page refresh.
    (the tests I ran were with the picture of wyatt).

    While I haven’t yet sat down to work on a proper solution, I would think it would involve disabling the onclick functionality of the links after an initial click and re-enabling it after the overlay is closed. A reference of the link itself could be passed back by the closing action with a method to re-enable the link disabled by the reference… anyway just a thought until I get to look into myself.

  313.   #313 Comment Posted by David Dixon on Jul 22, 07:49 PM

    Also, on a separate note, for any users having problems with the iframe method, as long as you JS knowledge is decent, then you can always hide the IE-specific code (which is what the iframe code is) with conditional comments. e.g:

    /*@cc_on @if (@_win32 && @_jscript_version>4)
    this is only seen by IE!
    @end @*/

    I use this kind of “hack” for a few functions that I have written (that use a very similar iframe hack for IE) and each one works perfectly (for IE as well as FF/Opera etc)

  314.   #314 Comment Posted by ccgooser on Jul 22, 10:03 PM

    OMG Cody.
    Ubelievable.
    How do I donate you some money for such an awesome effort??

  315.   #315 Author Comment on Jul 25, 04:40 AM

    @gonssal – Thanks for the offer, but I already have it working. Should be out soon.

  316.   #316 Comment Posted by cpj on Jul 25, 06:15 PM

    cool script. how do i get it to play nicely with lightbox v2? my guess is that both are using an onload call, but i’m not a js pro. it might be as easy as this, , but i don’t know what the right onload function(s) are for your script. your script works, but now the lightbox script doesn’t (just opens in another window). can you help?

  317.   #317 Comment Posted by Giancarlo on Jul 26, 03:07 AM

    very nice modal window. i already implemented thickbox on my homepage (ever changing ;-)).
    I got a question: let’s say i would like to open a new brwoser window FROM a tb window. My thought was of having the url i wish open in a span with display: none. But how do i get a new elements content and append it net to the TITLE on a new thickbox?

  318.   #318 Comment Posted by ovdncoke on Jul 26, 03:08 AM

    This looks very smart, thanks. One thing I thought I’d mention. I tried a modded script that grouped images which I know you are working on. However if used with images in a table it would only group the rows, not the whole table. Just something to look out for. Thanks.

  319.   #319 Comment Posted by Daniel of Luderbrus on Jul 26, 02:14 PM

    Its beautiful and everything. How do I get it to react to “lightbox” though? Instead of ‘rel=”thickbox”’ I want it to work for all the old posts as well where I used ‘rel=”lightbox”’. Thanks.

  320.   #320 Comment Posted by Gian Carlo on Jul 28, 08:42 AM

    Hi Cody,
    i implemented your thickbox ‘component’ into my homepage. thanx ;-))

  321.   #321 Comment Posted by webagent01 on Jul 31, 01:03 AM

    Very nice. I am using lightbox for my gallerys but have a contact form that I want to put in a thickbox but I am experiencing the same problem as Ian in comment 302. When I took the iframe init code out I see my box but as soon as I scroll it disappears and my page grows exponentially. The farther you scroll, the farther down it gets. I have a hunch it is a conflict in the css. I commented out pretty much all but the TB_ styles and it still does it. Any ideas?

    Stephen

  322.   #322 Comment Posted by webagent01 on Jul 31, 01:32 AM

    I have found the problem. The Thickbox code is being written to the page as html entities. I have no clue why it is doing this but I am sure it is the problem. Any ideas how to fix it?

    Stephen

  323.   #323 Comment Posted by Kay on Jul 31, 02:59 AM

    Yes,I think it*s great. With ThickBox it will be possible to get a new experience of interactivty.
    Thanks a lot !
    Greetings from Germany

  324.   #324 Comment Posted by Espen on Aug 1, 04:33 AM

    I cant get the new “documents” to have black as background color, any idea why?

  325.   #325 Comment Posted by John on Aug 1, 07:00 AM

    No longer works with FF. Any thoughts?
    Version 1.5.0.5 WINDOWS XP – didn’t work with earlier version either. I have taken off all FF extensions as well.

  326.   #326 Comment Posted by Jim on Aug 1, 04:39 PM

    Has anyone seen this error when implementing?

    o.getAttribute is not a function

  327.   #327 Comment Posted by Jim on Aug 1, 04:57 PM

    Let me rephrase, has anyone encountered a problem using thickbox inside a pop-up browser window? That is where I see a getAttribute error.

    Thanks

  328.   #328 Comment Posted by Ton van der Helm on Aug 2, 02:57 AM

    Very, very nice application. But there is always a ‘but’. I want to open a page via thickbox and show a Google Map but the page isn’t showing. Can it be that the javascript used by the Google Map page doesn’t work in thickbox? Do I have to place the javascript in the mainpage or something?
    Thanks for the reply!

  329.   #329 Comment Posted by christopher on Aug 2, 08:56 AM

    Cody – (i’m an idiot! seriously) are there issues using thickbox with pop-up calendar calls? can’t seem to get it to work and we’d really like to use it as part of a project… if you want we can past the script, but have hit a wall with this and the ability to use pop-up .js calendar call within…

    puh-leaz help!

  330.   #330 Comment Posted by Giancarlo on Aug 3, 05:05 AM

    I have a random strange behaviour in FF. When you click a thumbnail to get the modal window, not always it loads the new image.
    Something to do with a tiomeout issue? I

  331.   #331 Comment Posted by Sandy Thomson on Aug 4, 10:30 AM

    Hi, I have been looking at using this for one of our work sites (quite high traffic ~ 1M page views per month).

    However in IE 6 on both our dev machines, the thinkbox JS crashes the browsers entirely (needs task manager loaded to kill the process). In firefox and safari it works fine?

    There is no other JS on the page so I am a bit confused! I am using TB 1.2.

  332.   #332 Comment Posted by Sandy Thomson on Aug 4, 10:31 AM

    Oh yeah, it works in IE7 beta 2 as well, but not IE6!

  333.   #333 Comment Posted by Rehan Qaisir on Aug 8, 01:27 AM

    I am using .aspx page that uses a master page. The problem is that when i click on the tree items in the tree, thickbox does not work for the firsttime. It does work for subsequent clicks. What could be the problem.

  334.   #334 Comment Posted by LifeIsBeta on Aug 9, 03:28 PM

    Hey, awesome script…

    Got a couple questions:
    1) I’m calling ThickBox from an AjaxTabsContent script from Dynamic Drive. This script calls in the loaded html’s css via a ‘rev’ tag. Can ThickBox do the same?

    2)Can an image be used in place of a caption?

    Thanks!

  335.   #335 Comment Posted by Dizzle on Aug 10, 09:19 AM

    So… is there any way to pass parameters to a URL intended for a TB_iframe??

    e.g.
    a href=”add_edit.php?&TB_iframe=true&height=600&width=300&userid=2&page=101…etc…” class=”thickbox”
    doesn’t seem to work…

  336.   #336 Comment Posted by Drew on Aug 10, 09:44 PM

    @Dizzle

    http://codylindley.com/thickboxforum/comments.php?DiscussionID=11&page=1#Item_0

  337.   #337 Comment Posted by Adam on Aug 13, 11:43 AM

    Nice work. I really like the thickbox.

  338.   #338 Comment Posted by Mark Brown on Aug 16, 03:45 PM

    Nice work. Has anyone found a method to display (compare) two separate images side-by-side in a single frame? Is there an existing implementation of this that I haven’t seen?

    Thanks in advance,—Mark

  339.   #339 Comment Posted by Lee Jorgensen on Aug 24, 05:02 AM

    Mark – try putting the images into a .htm page and call that using Thickbox.
    Top program Cody! I’m using it in my long overdue rebuild.

  340.   #340 Comment Posted by Norbert Kurzka on Aug 26, 06:37 PM

    Hi Cody, love this work of you! And with a small enhancement from “Pure Essence” I don’t even have to change all those image links (http://pure-essence.net/archives/2006/08/20/thickbox-20-auto-detect-image-links/ ).
    But (there is allways a BUT) I not only see the image, the corresponding thumbnail is also shown. Curious thing, cause this only happens, when the page is fully loaded.
    Any hint for me?

  341.   #341 Comment Posted by luctay on Aug 28, 06:05 PM

    Much impressed by thickbox and have used it to create an image gallery. Wanting to add fairly long comments to images but it messes up the postion of the close button. Have tried playing with the CSS but no luck. Is it possible to remove the close button entirely (it doesn’t seem that necessary). I’m using Thickbox 2.0

  342.   #342 Comment Posted by Ronnie on Aug 30, 12:58 PM

    Yeah, Thickbox rocks, but I’m having issues with it and the Google Maps API Javascript. I’m trying to troubleshoot it right now, but if anyone has any input it would be great.

  343.   #343 Comment Posted by EmeraldRuby on Aug 31, 07:19 AM

    Hi, just came across this.. wonderful..
    1)will the issue with opening urls with parameters be fixed in the next version
    2)when is next version out?

    Tnx alot mate

  344.   #344 Comment Posted by Stephan on Aug 31, 10:08 AM

    Is there a way to have a page load with Thickbox already activated. I’d like to have a Flash play in Thickbox with the rest of my page grayed out right off the bat. Then the user can click X and browse the site. Is this possible?.. and if so how?

    Thanks!

  345.   #345 Comment Posted by jimy on Sep 4, 03:57 PM

    Great job. This is awesome. One thing I can’t nail down yet. Is there a way to just use onClick to call thickbox?

  346.   #346 Comment Posted by Phil on Sep 5, 08:51 PM

    HI, i understand this is great work, but of course… i’m using FF1.5.0.6 on a mac g4 laptop running os10.4.7, and the example demos aren’t working – all that happens is the bottom scroll appears and the more I click, the more space becomes visible to the right. strange, huh?

  347.   #347 Comment Posted by Lars on Sep 10, 07:18 PM

    Hi! Great work, thanks!

    In the interest of shaving bytes off the script, I’ve rewritten the image resising part to this: http://phpfi.com/151123

    I think it looks cleaner, and it’s a bit smaller :)

  348.   #348 Comment Posted by Bonnie on Sep 11, 09:27 AM

    I had the same question as Stephan… I would like to initiate thickbox onload.

  349.   #349 Comment Posted by Fus on Sep 25, 04:49 PM

    I’ve had some users that accidently hit back on their browsers when trying to close the thickbox (instead of hitting the Close Button)... is there a way to make it so the user can click back on their browser and it’ll close the browser (or make it look closed by simply loading the initial page without the thickbox on it)?

    Thanks and I love the script… wish people would notice the close button hehe

  350.   #350 Comment Posted by Richard Hammond on Sep 27, 03:37 AM

    If you try to pass the name of an image file in the query string for an HTML page, this will prevent the whole system from working.

    For example, if you want to display the following HTML file in a ThickBox:

    /somedir/someFile.php?id=9&filename=DSCF009.JPG

    Thickbox will wrongly assume you’re trying to display an image, rather than an HTML file.

    To fix this, see line #39 of the thickbox.js file, where the filetype is determined.

    I modified it as so:

    if(url.indexOf(”?”)!==-1) //If there is a query string involved
    var baseURL = url.substr(0, url.indexOf(”?”));
    else var baseURL = url;
    var urlType = baseURL.toLowerCase().match(urlString);

  351.   #351 Comment Posted by Mike on Sep 28, 04:38 PM

    Is there a way to have thickbox displayed when you move your mouse over a link instead of clicking?

  352.   #352 Comment Posted by tom on Sep 29, 04:16 PM

    nice! really!

  353.   #353 Comment Posted by Silverstorm on Sep 29, 04:20 PM

    Looks good. thx!

  354.   #354 Comment Posted by curmudgeon on Oct 2, 03:06 PM

    How about a ThickBox, or Lightbox, with Rounded Corners and a drop shadow? =)

  355.   #355 Comment Posted by chris on Oct 6, 04:13 PM

    I posted a tip for anyone that wants to use thickbox to display quicktime content on my blog: http://coderhythm.com/blog/?p=7. Without a little work, the movie continues to play after the thickbox closes on Safari.

  356.   #356 Comment Posted by chris on Oct 6, 04:15 PM

    I posted another tip for anyone that wants to use thickbox to display quicktime content on my blog: http://coderhythm.com/blog/?p=7. This one deals with getting Safari to play the movie as soon as thickbox loads the content.

  357.   #357 Comment Posted by scottua on Oct 12, 07:11 PM

    I’ve use lightbox and now want to graduate to thickbox. My problem is this. I’m using the thickbox to call in a page that has a flash movie embeded in it, but i’m calling the box from an iframe. When i do this the thickbox generates within that iframe. Is there a way to break the thickbox out of the iframe so it displays the content across the full browser window and not the inset iframe?

  358.   #358 Comment Posted by pasamelo on Oct 13, 04:00 PM

    These code is unusable in INTERNET EXPLORER. Every time I click on one of your thickbox my IEXPLORE.EXE process gets about 50MB fatter, past 5 or 6 clicks it turns unusable.

  359.   #359 Comment Posted by sacha on Oct 14, 09:15 PM

    Scottua, don’t use iframes and instead use an include in php or whatever it is in asp.

  360.   #360 Comment Posted by sacha on Oct 14, 09:52 PM

    Safari osx Bug Found.
    I am using a js to load a swf to a div for eolas.. maybe not an issue..
    but the flash on the main page shows through the thickbox window..

  361.   #361 Comment Posted by Robb on Oct 16, 11:57 AM

    I like this software and I was able to implement it with no problems but I have two questions.

    1. Can the prev/next links be positioned on the top of the box in an absolute position (centered)? That way they won’t change location when the box size changes and users can quickly click through if they wish without having to continuously ‘find’ the link.

    2. I have no javascript abilities (that’s why I’m using someone else’s code hehe). Is the ‘animations’ code that was removed actually removed or is it merely commented out (as in I could easily enable it again. I think fades or resizing would be nice.

    Thanks for a great piece of software!

  362.   #362 Comment Posted by Rburn99 on Oct 16, 01:47 PM

    I read a comment here by pasamelo claiming that iexplore’s memory usage increases dramatically with every click. I checked and I too am seeing a big time memory leak. Every time the overlay is created iexplore memory jumps approx 14mg. When the overlay is closed, instead of releasing the memory, it jumps up again… approx 2mg at close. Once an overlay is created you can click next/previous with no change in memory but you will very quickly run out of memory clicking and dismissing pictures.

  363.   #363 Comment Posted by austin on Oct 17, 02:04 AM

    i’d just like to ask why thickbox is not supported by FF browsers prior to version 1.5? thanks

  364.   #364 Comment Posted by barteks on Oct 18, 03:25 AM

    Cody – great code really. I used the ‘InLine’ module for Flash objects and HTML and seems to work smooth in Win IE/FF/Opera (except strange border in HTML arround images). I wonder if it’s possible to Combine the ‘InLine’ with ‘Gallery’ module to enable easier navigation – I am using it for flash portfolio and it would be more friendly to preview the samples as consecutive links rather than in open/close/open close drill:) Cheers.

  365.   #365 Comment Posted by Tim Rutter on Oct 19, 02:11 AM

    I found a problem with firefox sometimes not showing the background overlay transparency if there was no scroll bar. Firefox would not set window.scrollMaxY and window.innerWidth, so the script would fall back to use document.body.offsetHeight for the height which would be 0px if everything on the page was positioned leaving the body element without anything to render.

    Fix is as follows (is only a small edit but works):-

    function TB_overlaySize(){
    if (window.innerHeight || window.innerWidth) {
    yScroll = window.innerHeight;
    xScroll = window.innerWidth;
    if (window.scrollMaxY || window.innerWidth) {
    yScroll = yScroll + window.scrollMaxY;
    xScroll = xScroll + window.scrollMaxX;
    }
    var deff = document.documentElement;
    var wff = (deff&&deff.clientWidth) || document.body.clientWidth || window.innerWidth || self.innerWidth;
    var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight;
    xScroll -= (window.innerWidth – wff);
    yScroll -= (window.innerHeight – hff);
    } else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){ // all but Explorer Mac
    yScroll = document.body.scrollHeight;
    xScroll = document.body.scrollWidth;
    } else { // Explorer Mac…would also work in Explorer 6 Strict, Mozilla and Safari
    yScroll = document.body.offsetHeight;
    xScroll = document.body.offsetWidth;
    }
    $(”#TB_overlay”).css({height +”px”, width +”px”});
    $(”#TB_HideSelect”).css({height +”px”,width +”px”});
    }

  366.   #366 Comment Posted by Bret Truchan on Oct 21, 12:46 PM

    I was having to deal with conflicts between jquery.js and prototype.js. I’m only using a few functions from prototype.js, so I decided to use pt.ajax.js, which is a lightweight version of prototype.js. The $ function of pt.ajax.js conflicted with something in jquery.js. I fixed the conflict by editing pt.ajax.js and renaming the $ function to “plem” (or anything else that would reasonably work). I would not suggest this if your code uses the $ function in prototype.js.

  367.   #367 Comment Posted by jojo on Oct 22, 06:20 AM

    hello,
    is it possible that IE don’t show the active-x warning message?

  368.   #368 Comment Posted by Bret Truchan on Oct 22, 02:59 PM

    If you’re dealing with a lot of ajax calls in your pages, using thickbox might become a little tricky. With my project, once my ajax content is loaded, I have to re-parse the document (by manually calling TB_init) to update links in the dynamically loaded content. If you call TB_init twice over the same content, you can end up transforming your thickbox links twice. To avoid this, I modified TB_init like so:

    function TB_init(){
    $(“a.thickbox”).click(function(){
    var t = this.title || this.name || null;
    var g = this.rel || false;
    TB_show(t,this.href,g);
    this.blur();
    $(“a.thickbox”).removeClass(“thickbox”); // I added this line…
    return false;
    });
    }

  369.   #369 Comment Posted by jojo on Oct 23, 03:46 AM

    thank you, but this do not help.the warning massege in ie appear as usual. i have only html content on the page

  370.   #370 Comment Posted by jojo on Oct 23, 03:48 AM

    lol the problem is fixed :-) the massege appears only local, on the web not

  371.   #371 Comment Posted by G Z on Oct 25, 06:14 AM

    If it free to use thickbox for commercial use?

  372.   #372 Comment Posted by rxbbx on Oct 25, 12:47 PM

    Great stuff.. better as other versions.. thnx for your work..

  373.   #373 Comment Posted by orixilus on Oct 26, 07:12 AM

    those of you looking for a solution to have thickbox work with area maps, just add the following code:

    thickbox.js:
    (...)
    $(“a.thickbox,area.thickbox”).click(function(){
    (...)

    on your html page add the class “thickbox” to all your area elements

  374.   #374 Comment Posted by Jason Bunting on Oct 29, 12:10 PM

    Ported ThickBox 2.1 over to MochiKit, for those interested:

    http://jasonbunting.com/blahg/PermaLink,guid,297d24b0-f5e8-47d1-82e2-1804133fc6bf.aspx

  375.   #375 Comment Posted by wille on Oct 30, 04:51 AM

    I get errormessage: “Permission denied to get property Window.nodetype” when I use Thickbox on Firefox. Both 1.5 and 2.0.

    Any recommendations or solutions?

    Best regards from Sweden!

  376.   #376 Comment Posted by Val on Nov 2, 01:25 PM

    Kind of problem on Windows/Opera9
    After loading image, it is shown but not so smooth as in iexplore or firefox. I mean that effect while showing image, not the image itself.

    But anyway – great work.

  377.   #377 Comment Posted by thickbox_evaluator on Nov 4, 03:19 PM

    Small question regarding the licence: it mentions both the MIT license and the GPL

    So: is ThickBox explicitly dual-licensed and can I choose which one to apply to my usage, e.g. the more commercial-friendly MIT license?

  378.   #378 Comment Posted by Amin J. Ismaili on Nov 8, 08:40 AM

    Absolutely stupendous work.

    Problem: I see some extra spaces besides the CLOSE link when viewing in IE 6.0

    Here’s the JPG link which I captured…

    http://ismaili.amin.googlepages.com/THICKBOX.JPG

    Question 2: I want a auto close from my form to be made.

    Scenario: E-mail signup thickbox auto closes, once successfully send e-mail, else should remain on screen.

    I use IFRAME method to display ASPX pages.

    Any idea on this?

  379.   #379 Comment Posted by Ray on Nov 14, 03:53 PM

    So does anybody have a solution for the problem with the google maps api?

  380.   #380 Comment Posted by Ulsen on Nov 17, 10:47 AM

    Guys,

    i’m using Thickbox with a php site which is working fine when i call the link manually.

    My problem is that the Thickbox should called automatically when my site in which i use the box is loaded, what means that i need a solution like (body onload=”loadTheThickBox”) , but i found no way to solve this problem, any idea?

  381.   #381 Comment Posted by Pong on Nov 25, 10:43 AM

    I try to play a mpg file in the overlay…it works, but after I click [close] the overlay is remove but I can still here the sound of the movie

  382.   #382 Comment Posted by Steve on Nov 29, 11:43 AM

    >>>I get errormessage: “Permission denied to get property Window.nodetype” when I use Thickbox on Firefox. Both 1.5 and 2.0.

    I’m getting it too! Can’t figure it out for the life of me. Anyone have an answer?

  383.   #383 Comment Posted by >flo on Nov 30, 04:38 AM

    Same problem: “window.nodetype”

  384.   #384 Comment Posted by bryan on Nov 30, 06:28 PM

    Hey Cody,

    Loving thickbox, but i’m having a weird problem in FF: http://poseidon.diywebhosting.ca/~wwwshou/thick.jpg

    as you can see, the overlay is cutting off at where the footer/last div is. If i put a overflow:scroll in the body css, it works fine, but adds horizontal and vertical scroll bars.

    Strangely, it works fine in IE!!!

    b

  385.   #385 Comment Posted by icabod on Dec 4, 11:12 AM

    If you have a problem in IE where the dark overlay appears somewhere up the page (if you’ve scrolled down the page a little), here’s a quick hack that provides a kind of fix.
    Add the following to the end of the TB_position() function:

    $(”#TB_overlay”).css({top: (arrayPageScroll[ 1 ])+”px”, height: (pagesize[ 1 ])+”px”});

    It’s jumpy if you scroll the page, but it seems to work in my IE and Firefox.
    Nice stuff on the script, btw.

  386.   #386 Comment Posted by css menus on Dec 5, 10:01 AM

    any solution for the firefox issue?

  387.   #387 Comment Posted by Andy Ramblings on Dec 17, 10:45 AM

    ref: Permission denied to get property Window.nodetype
    I get it too when I try to integrate it as a blog plugin.
    baffles me completely. Works fine on the demo’s on this site.

  388.   #388 Comment Posted by liviopl on Dec 21, 12:44 PM

    When I will have my design on disk, I will implement there jQuery, jCarousel and of course, Thickbox, because it is amazing and very light script.

  389.   #389 Comment Posted by Offshore Outsourcing and Offshore Development Provider on Dec 26, 10:31 AM

    If it free to use thickbox for commercial use?

  390.   #390 Comment Posted by Zoran Isailovski on Jan 4, 03:30 PM

    Great stuff man!

    Just one remark:

    In thickbox.js (in a version I downloaded yesterday) there is the line

    $(“body”).append(”<div id=‘TB_load’><img src=‘images/loadingAnimation.gif’ /></div>”);

    This implicitly assumes format and location of the loading animation image, the latter being always relative to the html page location. This won’t work where pages are distributed across several directories (unless you put an “images” folder with the gif in it all over ;))

    Graybox, for example, uses a javascript variable to store the location of the image, which can be set differently in different contexts (i.e. in different pages).

    A more unobtrusive approach may be to first check whether there already is a <div id=‘TB_load’><img …>, and use it if there is one.

    You may also combine the two.

    Cheers, and have a happy new year :))

    — Zoran Isailovski

  391.   #391 Comment Posted by Zoran Isailovski on Jan 4, 05:24 PM

    Me again… ;-)

    After thinking it over, I would probably prefer something like

    <link rel=“TB_LoadingAnimationImage” href=”...”>

    to specify a page-specific loading animation image.

    As you might have guessed, I’m trying to avoid having a

    <script>TB_LoadingAnimationImage = ...</script>

    in a html document. Am I overly puritanistic in this respect?

  392.   #392 Comment Posted by Jason Leveille on Jan 12, 08:27 AM

    Really awesome. Thank you for sharing your hard work with the masses.

  393.   #393 Comment Posted by Chung on Jan 12, 11:51 PM

    If loadingAnimation.gif is specified as a background image in the thickbox.css file instead of being inserted using the image tag, it can be referenced with a relative path instead of an absolute path. This would simplify installation a little bit, separate content and presentation, and give some other benefits of using a relative path.

  394.   #394 Comment Posted by Rick Melchior on Jan 16, 04:06 PM

    Is there a way to make thickbox work from a hotspot on an image? I’m a .js newbie. All works except link goes to html page not a thickbox

  395.   #395 Comment Posted by brian Ngana on Jan 19, 07:20 AM

    Nice resource, I have added your link on www.ajaxshack.com

  396.   #396 Comment Posted by Chris on Jan 22, 12:40 PM

    I am using this snippet to allow for area (image) map use:

    Thickbox.js:
    (...)
    $(“a.thickbox,area.thickbox”).click(function(){
    (...)

    But this does not allow for the “gallery” function of Thickbox.

    Does anyone know how to add the “gallery” option using the ‘rel=“gallery-name”’ inside an area tag?

    Love your script Cody…. keep it up!

  397.   #397 Comment Posted by Chris on Jan 24, 01:17 PM

    Any ideas on how to use thickbox + POST form data at the same time…

    Problem: when using POST form data and calling a Thickbox page that then forwards to a seperate landing page (where the POST data needs to be passed) I get an error:

    Error: uncaught exception: Permission denied to call method XMLHttpRequest.open

    in Firefox and this error:

    Security Violation

    in Opera….

  398.   #398 Comment Posted by Chris Prakoso on Jan 26, 03:59 AM

    After scrolling and reading through the whole comments on this page, is it correct for me to conclude that Thickbox can’t go hand in hand with Prototype (without considerable amount of code changes in either) ? I would really like to use TB, but I also need to use Scriptaculous and Behaviour. Any idea ?

    Cody, thanks for all your effort to bring this. Hope you had a good New Year.

  399.   #399 Comment Posted by Chris Prakoso on Jan 26, 04:51 AM

    Ok, I guess I didn’t scroll ‘deep’ enough.

    For the benefit of anybody there who wants to use Thickbox (JQuery) as well as Prototype family (Scriptaculous etc), please read the followings:

    http://codylindley.com/thickboxforum/comments.php?DiscussionID=354&page=1#Item_0
    http://jquery.com/docs/PrototypeAndJQuery/

  400.   #400 Comment Posted by Okankan on Feb 2, 06:10 AM

    very nice resource..

  401.   #401 Comment Posted by Ty on Feb 2, 11:03 AM

    I was worried about printing images loaded in the thickbox, with a javascript print command, not any more. Just right click print them in IE or firefox.
    Note (@jakob#188 above)
    Get the “Print Image”
    extension to have the right-click functionality added to firefox https://addons.mozilla.org/firefox/531/
    You’ll soon forget that it didn’t have it before.

    A javascript print link would still be handy… anyone?

  402.   #402 Comment Posted by pokerplayer on Feb 3, 03:04 PM

    thickbox&jquery… very very very nice job both

  403.   #403 Comment Posted by Nader on Feb 5, 06:59 PM

    Really cool widget, I have a question, I need to add a button in an iframe that closes the TB, I’ve tried loosing focus, but no luck.

  404.   #404 Comment Posted by Paul on Feb 8, 07:48 AM

    I’ve implemented a layer drag’n‘drop idea on my website using javascript and div layers. When i move a layer it seems that the opaque background doesn’t appear anymore when you click on a ThickBox link, any idea how to sort this? Really cool widget tho.

  405.   #405 Comment Posted by ImSir2U on Feb 8, 02:47 PM

    Hey Cody, this is a really cool piece of code, I’m a learning web developer that has bitten off more than he can chew and someone told me about this so I’ve implemented it on my asp site and, even though I still know diddly-squat, I’ve managed to not only get it working but customise it so it looks how I want it to on my site… Anyone interested, have a look at www.wellingtondining.co.nz/test and do a search for “Sahara Cafe” and check out the menu and photos (just silly test photos and data in the photos page at the moment for implimenting this). Once I’ve completed testing it’s going on the live site www.wellingtondining.co.nz !! Thanks heaps for such a useful bit of code… Anyone got any more improvement suggestions for my site then give us some feedback – like I say, I’m learning as I go and probably making lots of terrible beginner site mistakes you pros could tell me off for! lol ;-)

  406.   #406 Comment Posted by Rajiv on Feb 20, 09:23 PM

    Excellent Widget.. I am using it in my travelogue site for Images :
    http://www.wheelsandroads.com

  407.   #407 Comment Posted by SeoCoder on Feb 27, 07:42 AM

    Realy work.
    Im translate with text to russian.
    Thanks from Russia

  408.   #408 Comment Posted by stealthmode on Feb 28, 12:32 PM

    Has anyone been able to get thickbox working on a Mac 10.4, with Firefox 2?

    If so, can you please post what your fix was?

  409.   #409 Comment Posted by andrew on Feb 28, 04:36 PM

    It’s not working on Konqueror (last version, 3.5.6). A blank page overlaps everything. I tried playing with CSS’s z-index but couldn’t get it working.

  410.   #410 Comment Posted by FP Images on Mar 15, 12:14 AM

    I included html tags into the title (links and br)
    and, seems like, the thickbox height is wrong in Firefox.
    Any ideas?

    http://www.featurepics.com/Thickbox/Image-Gallery.aspx

    IE – just perfect!

  411.   #411 Comment Posted by Boris on Mar 19, 09:24 AM

    I’ve make a port of Thickbox for Mootools.
    I thought it would be cool to have it working with Mootools.
    I added a small opacity effect when the window shows up, and on scroll.
    Here is the project homepage : http://labs.gueschla.com/smoothbox/

  412.   #412 Comment Posted by ike on Apr 11, 04:55 PM

    I’m using ThickBox (and another jquery tool, J-Tip) on my site, and for some reason when I access it from a computer outside my network, ThickBox and J-Tip don’t always work. I often have to refresh the page a few times before they work. Any ideas? My html validates.

  413.   #413 Comment Posted by Sebastian on Apr 13, 07:46 AM

    Hello,
    Thickbox is very great! But how can i open an Thickbox with the HTML-button-tag?

    I’m trying something like this:

    [button name=“zoom” type=“button” class=“thickbox” style=“background-color:transparent; border:0px;” alt=“Vergrößern” value=“1” onClick=“window.location.href(‘http://mysite/mypic.jpg’)”] [img src=”../pix/button_lupe.gif” ]
    [/button]

    But it doesn’t work?? Whats wrong with the syntax?

    Thanxx for Help!

  414.   #414 Comment Posted by Mor on Apr 13, 10:32 AM

    Same problem with Mac Firefox. Gray background is cut to the size of the image and not to the screen itself. Opera, IE, Firefox on pc, all work well!

  415.   #415 Comment Posted by Paul Springett on Apr 20, 09:29 AM

    I used a work around for the problem with flash objects displaying over thickbox.

    In the thickbox.js file I added the lines:

    $(“object”).hide();
    $(“embed”).hide();

    into the thickbox show function

    and then added:

    $(“object”).hide();
    $(“embed”).hide();

    into the thickbox remove function.

    Because TB darkens out most of the page, if you design your right, it’s hardly noticable.

  416.   #416 Comment Posted by Paul Springett on Apr 20, 09:31 AM

    Correction.

    The second set should be:

    $(“object”).show();
    $(“embed”).show();

    My bad.

  417.   #417 Comment Posted by Mike Windham on May 8, 04:19 PM

    Hello, can any one tell me why this works in ie 6 and firefox but not ie 7.

    e-mail me please if you have an answer mike@newspin360.com

    http://demo.newspin360.net/echocanyon_tb/Tour_echo.html

  418.   #418 Comment Posted by Fletch on May 18, 11:26 AM

    Cody,

    I’ve managed to rip out ALL my sparse head covering trying to get ‘Thickbox’ to work to a Blogger-uploaded image. No luck so far.

    You can take a look at: the example post at

    http://terrysplaypen.blogspot.com/2007/05/picture-displays-101b.html

    and if you have ANY suggestions I would be ‘over the moon’.

    Thanks.

  419.   #419 Comment Posted by Fletch on May 18, 05:35 PM

    Re: my comment at #418

    I found the little gremlin. The URL being called was something like:

    http://bp2.blogger.com/ . . . /s1600-h/mypic.jpg

    Turns out that the ‘switch’ (at least I think it is a switch) “-h” in the URL was not allowing the image to be shown. By removing the switch I’ve now managed to have Thickbox work as it is designed to.

    Next challenge is to find where I can point Blogger (blogpost) members for the relevant ‘js’ files if they can’t be uploaded to Blogger itself. But that’s not much of a problem as I am pointing them at my static site, and I manage to keep up to date with the changes!

    Thanks for reading.

  420.   #420 Comment Posted by Mike Windham on May 24, 07:49 PM

    Can some one please look at post #417 I have the three links on the bottom of html using thick box for my contact and map and send to friend.

    Works great except for IE 7. Please help need to use it right now.

    http://demo.newspin360.net/echocanyon_tb/Tour_echo.html

  421.   #421 Comment Posted by Jimmy Jones on May 30, 01:44 PM

    Is there a way to prevent thickbox.css from changing the default padding and margins? or how can I restore the default paddings and margins back once thickbox has been setup?

  422.   #422 Comment Posted by Webdawson on Jun 12, 02:56 PM

    Hi, first of all i really love this Thickbox Script , it’s still awesome!
    I have a small problem maybe anyone can help me:
    I’ve tried to open a ThickBox window from a link in a google map bubble – but that’s not working. Any ideas why or how to fix that? Thank you very much.

  423.   #423 Comment Posted by EdBoy on Jun 17, 09:38 AM

    I happen to be using a different AJAX on my SourceForge project (linked above), and it loads pages into a DIV. Thickbox works on the normal page, but it won’t work on the div where pages are loaded. That’s the problem because… Well, one of the pages which is loaded into the div is the only one using thickbox, and it needs it.

    Is there any way for it to go outside of that div?

  424.   #424 Comment Posted by Anti on Jun 23, 06:53 PM

    I’ve been reading and experimenting with no luck of my own. So I come looking for guidance. I have a website with a few products I sell on it through paypal. Currently whenever someone clicks my Add to Cart button i have it opening in a new page/tab. I would love to instead have the paypal cart page load into thickbox though. I just can’t figure out if it is possible how to call it.

    Any suggestions? ###CODE###
    form target=“paypal” action=“https://www.paypal.com/cgi-bin/webscr” method=“post”
    input type=“image” src=“https://www.paypal.com/en_US/i/btn/x-click-but22.gif” border=“0” name=“submit” alt=“payments”

  425.   #425 Comment Posted by nick on Jun 29, 03:04 PM

    Sorry for the double post. for some reason my comment got cut off

    First off all. Awsome script. I use it all the time. My problem is if my url contains get variables the size of the dialog is ignored. I am using the hiddenModalDialog example.

    For instance:
    somescript.php works fine
    somescript.php?var=thisvar
    with get var thickboxes will be bugged and ignore my height and width declarations

    let me know if it is fixed

  426.   #426 Comment Posted by Web site design on Jul 15, 09:24 PM

    I would love to know how to get a .swf with video to work!

  427.   #427 Comment Posted by Hundehalsband on Jul 17, 05:06 PM

    Thanks for very interesting article. btw. I really enjoyed reading all of your posts. It’s interesting to read ideas, and observations from someone else’s point of view… makes you think more. So please keep up the great work. Greetings.

  428.   #428 Comment Posted by Michael on Jul 18, 11:09 PM

    When clicking a thinkbox link in content loaded via an AJAX call the thickbox link content displays the HTML markup.

    If I include:

    $(document).ready(function(){ tb_init(‘a.thickbox, area.thickbox, input.thickbox’); });

    in the AJAX file the thinkbox will work in FF but not IE, if another thinkbox link is clicked on the same page though the thickbox will be initiated again and display twice.

    Has anybody got thickbox working nicely with AJAX generated content?

  429.   #429 Comment Posted by Agung on Jul 31, 07:31 PM

    Thank you orixilus for your coding. I already add that code, and it works!

    thanks again.
    ———————-

    those of you looking for a solution to have thickbox work with area maps, just add the following code:

    thickbox.js:
    (...)
    $(“a.thickbox,area.thickbox?).click(function(){
    (...)

    on your html page add the class “thickbox? to all your area elements

  430.   #430 Comment Posted by meganwh on Aug 2, 04:00 PM

    Also getting the error: “uncaught exception: Permission denied to call method XMLHttpRequest.open” on both Mozilla 1.7.8 and Firefox 2 on Windows XP SP2. The files being called are on the same server within the same directory, so they shouldn’t be seen as external files. Four other people who have posted comments also seem to have the same problem. Any idea what the issue is with this error message?

  431.   #431 Comment Posted by Nikko on Aug 15, 01:43 PM

    I found a way to show the box on page load.

    I added the following to the head of the page:

    <script language=“JavaScript”>
    <!—

    function showBox()
    { tb_show(“Important message”, “box.php?KeepThis=true&TB_iframe=true&height=400&width=600”, false);
    }

    —>
    </script>

    Then changed the <body> tag to:

    <body onload=“showBox()”>

    At least if worked for me in Opera.

  432.   #432 Comment Posted by CHRIS on Aug 27, 12:35 AM

    Hi all. Was wondering if you can pass variable from parent to child (thickbox).
    Example: (using IFRAME)
    I use the A href to call an ASPX page (I also insert additional variables that I need on that page, so I have the usual setup parameters for the thickBox but I have a few of my own as well, i.e. an ID for example)

    but when I try and use any request variables then is nothing in them. Any suggestions.

  433.   #433 Comment Posted by Gavin on Aug 29, 05:57 AM

    I’m sure a few people have asked this but I am unable to find an answer.

    I need to use Thickbox, but I would like Lightboxes prev/next button functionality.

    Has anyone managed to do this yet?

  434.   #434 Comment Posted by RichText on Sep 3, 08:05 AM

    Hi Cody. Great stuff. I’ve been using the prototype window library up to now (http://prototype-window.xilinus.com/) but I’ve recently found a few problems with it. Your approach seems to offer the same functionality but in a slicker, more compact format (and hopefully one that works properly). ;)

  435.   #435 Comment Posted by RichText on Sep 3, 08:21 AM

    I’d like to update some content on the page FROM WHICH the thickbox was launched (i.e. the original page), as a result of what happened in the thickbox. With the protoype window library, there are callbacks you can hook into for OK/Cancel, so that you can fire off an ajax request. Is there a tried and tested technique for doing this with thickbox?

  436.   #436 Comment Posted by Albert con la febbre on Sep 6, 05:52 AM

    Hi, thanx for your work!
    I use the thickbox on my blog. It works very fine.
    I have got two questions. How can I translate the text (Image, next, prev, close) in the thickbox?
    How can I allign the thumbnails on the page of my blog( http://www.lafebbre.ch/2007/09/02/nadia-e-ale/ )?
    Sorry for these silly questions but I’m not really a programmer…
    Thanx for your time.

    Albert

  437.   #437 Comment Posted by - phil - on Sep 11, 02:31 AM

    Hi,
    Is somebody how can tell me how to refresh the calling page when closing the thickbox “popup” ?
    Regards.

    - phil –

  438.   #438 Comment Posted by Channa L. on Sep 13, 08:36 AM

    What I did to refresh the page when the thickbox was closed was, in TB_remove() function, I added another function “TB_closeCallBack();”.

    ............

    function TB_remove(){
    $(”#TB_imageOff”).unclick();
    $(”#TB_overlay”).unclick();
    $(”#TB_closeWindowButton”).unclick();
    $(”#TB_window”).fadeOut(“fast”,function(){$(’#TB_window,#TB_overlay,#TB_HideSelect’).remove();});
    $(”#TB_load”).remove();

    // call back
    TB_closeCallBack();
    return false;
    }

    function TB_closeCallBack(){}

    ............

    And in the page I use thickbox,

    function TB_closeCallBack(){
    window.location.reload(true);
    }

    Channa

  439.   #439 Comment Posted by Robert on Oct 2, 09:19 AM

    Channa,

    I am attempting to implement what you said and I am unable to ge tit to work. I added the code to the thickbox.js file:

    ..........................

    function tb_remove() { $(”#TB_imageOff”).unbind(“click”); $(”#TB_closeWindowButton”).unbind(“click”); $(”#TB_window”).fadeOut(“fast”,function(){$(’#TB_window,#TB_overlay,#TB_HideSelect’).trigger(“unload”).unbind().remove();}); $(”#TB_load”).remove();

    // call back TB_closeCallBack(); return false; if (typeof document.body.style.maxHeight == “undefined”) {//if IE 6 $(“body”,“html”).css({height: “auto”, width: “auto”}); $(“html”).css(“overflow”,”“); } document.onkeydown = “”; document.onkeyup = “”; return false;

    }

    function TB_closeCallBack(){}

    .........................

    I beleive that is the correct way to do it. Then I added:

    .........................

    function TB_closeCallBack(){
    window.location.reload(true);
    }

    To the page that loads the thick box and I haven;t had any luck with the page refreshing. Any Ideas?

    ..........................

  440.   #440 Comment Posted by Robert on Oct 2, 09:38 AM

    I fixed the problem I was having, I used a lower case TB in one place. I am still have an issue with Firefox 2.0, It doesn’t reload the page. It does reload the page in IE 7 and IE 6 though.

  441.   #441 Comment Posted by Rafi on Oct 9, 06:23 PM

    I’m having a style related problem when including the thickbox css file to my application. It makes all my dropdown menus to shrink in width, so that they don’t show the full text of the option with the maximum length.

    I was looking to put this comment in a thickbox main site. But the site http://jquery.com/demo/thickbox/
    don’t seem to have any option for putting comments or questions. So, I’m just leaving it here with a hope that someone will answer!

  442.   #442 Comment Posted by Ashish on Oct 9, 11:49 PM

    Hi,
    I want to pass a parameter in thickbox url..
    like this ..
    TB_show(‘Login to Continue’,‘login_box.php?return=posting.php?f=2&g=5&amp;height=170&amp;width=250’,null);

    thickbox is taking only 1 parameter. i want to pass more than 1 parameter..
    how is it possible??
    Please help ..
    Thanks
    Ashish.

  443.   #443 Comment Posted by Byron on Oct 11, 11:50 AM

    Hi Cody,

    I love this script by the way. And I really want to keep using it, but I’m getting this error and I can’t find any solutions out there for it.

    It even conflicted with an Ajax Login plugin for wordpress I was using for Firefox. Just made it totally broken. That’s fine because I’ll use the standard meta plugin to keep Thickbox.

    My question is this:
    How do I get the runtime error:
    ’style’ is null or not an object

    To go away in IE6?

    I’d also eventually like to bea ble to use the Ajax Login plugin with it too in wordpress 2.2.

    http://jonas.einarsson.net/ajaxlogin

    I just wanted to say something about this conflict with this plugin becaue others out there might be having the same issue and there might be an easy resolution? Do you now of one?

    A way to clear the runtime error for IE6 would be awesome?

    Thanks Cody. I really appreciate it.

    Byron

  444.   #444 Comment Posted by nbmnb on Oct 11, 10:52 PM

    nnbm\jhkm

  445.   #445 Comment Posted by gazeteler on Oct 23, 05:37 AM

    Would be cool if there could be a way to cancel the loading screen though; on a slow connection you might get stuck waiting for the image to load.

  446.   #446 Comment Posted by fal on Oct 23, 05:38 AM

    Is ThickBox supposed to be modal? On any of the examples if I click outside the Thickbox it disappears and the overlay goes away effectively putting me back where I started. Thx!

  447.   #447 Comment Posted by youtube on Oct 23, 05:39 AM

    If the document has no scrollbars then the grey shade that visually marks the document as inaccessible flashes but disappears immediately.

  448.   #448 Comment Posted by krpata111 on Oct 25, 04:08 AM

    :o)

  449.   #449 Comment Posted by zurie on Oct 25, 02:27 PM

    I am “forcing” my thickbox to load iframes rather than letting it figure out if its a image, ajax, iframe… i am unable to use a width, height, etc to my URL.. so no ?=‘stuff after the questionmark’

    Inside my thickbox.js I have setup a FIXED width and FIXED height. What I want to know is… is there a way to define that fixed width and fixed height in the body of a new page… and have that page resize the thickbox that the page resizing loads into..

    let me explain easier..

    webpage with a Link “A” that opens a thickbox..

    you click “A” and the box opens..

    INSIDE the thickbox, you click another link, the thickbox refreshes with the new link “B” clicked via the first page “A”.

    I want to know if you can put code in “B” that tells the current iframe to resize to a new size? or can you put code in “A” that tells itself to resize to a new size when you click the link to goto “B” from inside “A”.

    hope this makes sense… might require a new function.. i know you can do it with resizing images… so why not be able to do it with resizing pages and put the sizes you want inside the head of the new pages, or body, or somewhere… any suggestions??