function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
svdsvd 

How to close LightBox in VisualForce

Hello,

 

I installed lightbox component from appexchange. instead of hiding the box, is there a way to close the box ?

 

Given code in the component

 

box.setContentInnerHTML("<a href=\"#\" onclick=\"box.hide();\">Close</a><br /><br /><p>{!content}</p>");

 

Instead of hiding it, I want to close the box (lightbox window). For eg, if I'm playing audio content, this function will hide the box but still play the audio. So I want to close the lightbox window completely.

 

Thanks in advance for your help.

 

Pradeep_NavatarPradeep_Navatar

Have you tried box.remove() or box.dispose() in place of box.hide()? Try the sample code given below :       

 

box.setContentInnerHTML("<a href=\"#\" onclick=\"box.remove();\">Close</a><br /><br /><p>{!content}</p>");

 

Hope this helps.