jQuery-ThickBox (Launch thickbox onload instead of onclick)
I wanted to add a light box/light window/thick box in one of my servlet application, started looking on the web and found few ajax libraries and they are as follows.
Kevin Miller: Light Window =
I made this one work but had problem with positioning.
Lokesh Dhakar: Light Box =
His entire demos were for images, I need to open up an html file in the light box.
Lightbox is for images only. Try an alternative solution such as: Litbox, Litwindow, or Thickbox.
Cody Lindley: Thick Box 3.1=
Thick box is written on JQuery library. It worked like a champ at the first time and I was able to pass an html file, width and height perfectly. It worked when I clicked a link like this.
<a href=”body/blank.html?height=120&width=400″ class=”thickbox” title=”CD ROM Order Support”>Thick Box</a>
Problem: I could not figure it out how to make a thick box open with page on load,
Launch thickbox onload instead of onclick
Tried these, did not work.
window.open(“body/blank.html?height=120&width=400 class=thickbox title=CD ROM Order Support”);
At the top of the page I have added this, and it worked great. $ (dollar) sign is necessary; this ain’t PHP or Perl. $() -> Dollar sign and brackets construct a new jQuery object.
tb_show(“CD ROM Order”,”body/blank.html?height=120&width=400″,”images/cart.jpg”);
Q: $(“div > p”).css(“border”, “1px solid gray”); What does it mean?
A: Finds all p elements that are children of a div element.
<script src=”http://code.jquery.com/jquery-latest.js” />
$(“div > p”).css(“border”, “1px solid gray”);
<p>one</p> <div><p>two</p></div> <p>three</p>
Quote: “Knowledge is its own reward” … Cody Lindley
48 Comments »
Leave a Reply