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, 02: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, 03: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, 03: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, 03: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, 03:57 PM

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

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

    This is great. Lightbox is growing and morphing everyday.

  7.   #7 Comment Posted by Matti Putkonen on Apr 24, 04: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, 04: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, 04:40 PM

    Nice work Codey. Very nice work.

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

    @Dennis & Tyler – Thanks guys.

  11.   #11 Author Comment on Apr 24, 04: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, 05: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, 05: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, 05:15 PM

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

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

    Cool.
    I’d take it. ;)

  16.   #16 Comment Posted by Patrick Fitzgerald on Apr 24, 05: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, 05:43 PM

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

  18.   #18 Comment Posted by Dave Lowe on Apr 24, 05: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, 06: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, 06: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, 06: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, 06:38 PM

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

  23.   #23 Comment Posted by Matti Putkonen on Apr 24, 07: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, 07:13 PM

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

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

    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 25, 12:34 AM

    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 25, 12:56 AM

    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, 02: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, 02: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, 03: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, 03:48 AM

    This is Wonderful!

  32.   #32 Comment Posted by suexID on Apr 25, 04: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, 04: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, 05: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, 06: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, 06: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, 07: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, 07: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, 09:44 AM

    Download?

  40.   #40 Comment Posted by frequency decoder on Apr 25, 10: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, 10: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, 10: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, 10: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, 10: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, 11: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, 11: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, 11:19 AM

    Thank you Cody!
    That helps a lot :)

  48.   #48 Comment Posted by Jason on Apr 25, 11: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, 11: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, 11: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, 12:12 PM

    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, 12:36 PM

    @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, 01:02 PM

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

  54.   #54 Comment Posted by Curt on Apr 25, 01: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, 01: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, 02: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, 02:54 PM

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

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

    I can’t wait to use this!

  59.   #59 Comment Posted by Michael Long on Apr 25, 03: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, 03: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, 03: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, 03: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, 03: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, 03: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, 05: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, 05:26 PM

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

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

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

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

    Download link should be backup now. Refresh.

  69.   #69 Comment Posted by Michael on Apr 25, 11: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 26, 12:11 AM

    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, 04: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, 05: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, 06: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, 07: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, 07: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, 07:44 AM

    Thanks

  77.   #77 Comment Posted by Replay2x on Apr 26, 09: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, 09: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, 09: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, 10: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, 10: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, 10:29 AM

    Works fine in Opera 9.0 TP2 =)

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

    I’m loving it, thanks Cody :)

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

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

  85.   #85 Comment Posted by Dave Lowe on Apr 26, 11: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, 11:23 AM

    Great work, I think I will use it soon.

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

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

  88.   #88 Comment Posted by Burton on Apr 26, 01: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, 02: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, 02: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, 02: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, 05: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, 09:45 PM

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

  94.   #94 Comment Posted by Paul on Apr 26, 10: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, 10: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, 10:49 PM

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

  97.   #97 Comment Posted by Mal Jones on Apr 26, 11: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, 02: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, 08:26 AM

    @Daisaku – Sure, use what you like.

    @Mal – What browser are you using?

  100.   #100 Comment Posted by Mal on Apr 27, 09: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, 12:24 PM

    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, 01: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, 01: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, 04: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, 09: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, 11: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, 02: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, 02: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, 06: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, 06: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, 07: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, 08:39 AM

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

    Cheers

  113.   #113 Comment Posted by swordfish23 on Apr 28, 09: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, 09: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, 09: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, 09: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, 09:51 AM

    Sorry I meant the loaded HTML background transparency.

    Cheers

  118.   #118 Comment Posted by Drake on Apr 28, 01: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, 04: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, 04: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, 06: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, 06: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 29, 12:40 AM

    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, 04: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, 04: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, 11: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, 01: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, 05: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, 10: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 May 1, 12:00 AM

    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, 02: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, 06: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, 05: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, 01: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, 07: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, 12:01 PM

    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, 05: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, 05: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, 02: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, 02: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, 05: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, 09: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, 10: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, 01: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, 01: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, 06: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, 06: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, 08: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, 12:19 PM

    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, 02: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, 09: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, 01: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, 03: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, 04: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, 04: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, 05: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, 05: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, 05: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, 06: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, 07: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, 07: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, 08: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, 05: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, 11: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, 05: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, 05: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, 11:06 AM

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

  168.   #168 Comment Posted by Loni2Shoes on May 8, 05: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, 01: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, 09: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, 12:00 PM

    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, 01:40 PM

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

  173.   #173 Comment Posted by Gale on May 10, 08: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, 10: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, 11: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, 05: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, 04: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, 07:28 AM

    re #174

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