configure Thickbox dynamically

I just wanted to use on thickbox file for several environments(the same file available under several urls), but I noticed that I have to set the loadingAnimation-image-url statically, so I thought let’s change that and I made a patch, so that you just only need to set the variable TB_LoadingAnimation to the position of the image. I does not matter if you set it before or after loading thickbox.js. Here’s the code which I added on top of the thickbox.js file, it checks whether the variable is already set and if not sets it to the default.

// set the location of the animation shown
// while loading the content of a Thickbox
if(TB_LoadingAnimation === undefined) {
    var TB_LoadingAnimation = "images/loadingAnimation.gif";
}

Later in the thickbox.js I replaced the image url with the TB_LoadingAnimation variable. For those who want to use it, here I have for you:

technorati tags:, , , ,

Blogged with Flock

0 Responses to “configure Thickbox dynamically”


  1. No Comments

Leave a Reply