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:
- the patch which could be used for applying on your “already-in-use-modified” thickbox
- or the whole 2.1.1 thickbox.js, so that you don’t get into the “apply a patch”-mess.
technorati tags:javascript, patch, thickbox, TB_LoadingAnimation, jquery
Blogged with Flock
0 Responses to “configure Thickbox dynamically”
Leave a Reply