jqueryfacebox

How can i make a facebox display inside a div?


I have few web pages where i use facebox, which when called appends to body and display the conntent in the middle of the page, but i need to change this setting in only one page, where the content should appear in the middle of a div and the "#facebox_overlay" div also.

Any idea how can i achieve it?

$(".main").append('<div id="facebox_overlay" class="facebox_hide"/>')

used the above code but this wont override the code written in js file which is

$("body").append('<div id="facebox_overlay" class="facebox_hide"></div>')

Solution

  • Got the trick, on click when the facebox opens, add following code for the click function

     $("body").remove('#facebox_overlay');
     $(".main").append('<div id="facebox_overlay" class="facebox_hide" />');
     $("#facebox").appendTo(".main");