Popup image code using jQuery

Asked By 0 points N/A Posted on -
qa-featured

I wants to display a popup image by using the jQuery language.

Quote the solution how can i do this.

SHARE
Best Answer by Sharath Reddy
Answered By 0 points N/A #159689

Popup image code using jQuery

qa-featured

Hi,

I think you are familiar with jQuery. So, just do the following to display a popup image:

Create a link element first.

Give the link a class attribute with a value of thickbox (class = "thickbox")

Provide a path in the href attribute to an image file (.jpg .jpeg .png . bmp)

Now show your popup image.

Is it helpful?

Thanks for asking.

Hathy

Best Answer
Best Answer
Answered By 564965 points N/A #159690

Popup image code using jQuery

qa-featured

Since you want an image that pops up using jQuery, you can use ThickBox to accomplish it. Actually, besides using ThickBox, there are also other methods you can use to achieve this like for example you can use LightBox, FaceBox, FancyBox, PiroBox, and NyroModal. But here, I’ll explain ThickBox. ThickBox was created using super lightweight jQuery library. Its uncompressed size is only around 58k and when compressed, it is only around 20k.

Its function is to resize an image or images that are bigger than the browser window and gives flexibility. It can hide form elements in Microsoft Internet Explorer 6 and the box remains centered in the window even if you adjust the size of the web browser or scroll the page up or down. ThickBox will close if you click the overlay, or click the “close” link, or simply click the image. As much as I want to display here the full contents of the scripts, it would occupy too much space. The best way to learn it yourself is to download the demo from Ajax Daddy | jQuery ThickBox.

Login/Register to Answer

Related Questions