Category: developers journal

ThickBox and pictures that are handled dynamically via server side code

Author: seven May 11, 2007

After initial swfObject madness , I really started to like jQuery. Cody Lindley wrote ultimate hybrid modal window plugin called ThickBox. Today, however, I encountered little problem with ThickBox. ThickBox checks a href tag for class called thickbox. If that classname is found, script checks for href filename extension and if it is one of known image formats, it shows picture as a picture. If not, it shows content as a plain text.

I wanted to use it on a pictures that are handled dynamically via server side code. I inserted simple param check, to be able to force file extension.

[ftf]

var queryString = url.replace(/^[^\?]+\??/,”);
var params = tb_parseQuery( queryString );
if (params[‘forceExtension’] != ”) {
urlType = params[‘forceExtension’];
}



Single Image
[/ftf]

Author
seven
CEO/CTO at Nivas®
Neven Jacmenović has been passionately involved with computers since late 80s, the age of Atari and Commodore Amiga. As one of internet industry pioneers in Croatia, since 90s, he has been involved in making of many award winning, innovative and successful online projects. He is an experienced full stack web developer, analyst and system engineer. In his spare time, Neven is transforming retro-futuristic passion into various golang, Adobe Flash and JavaScript/WebGL projects.

    Leave a Reply

    Your email address will not be published. Required fields are marked *