1) Script Title: facebox
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...ebox/index.htm
3) Describe problem: I am having a strange problem with facebox breaking if I use innerHTML on a div calling that calls it. In fact I have a tiny demo that merely gets the innerHTML of the div and then immediately sets it back without even modifying it -- i.e. essentially a nop. From then on the facebox popup won't appear. I thought this might have something to with escapes but now that I have this trivial example I don't think so. I'm at a loss as to how such a "simple" operation that doesn't even change the div's contents can possibly break facebox action. I'd really like to use facebox as I like it's look but I have to be able to modify the contents of the divs using it (not the target of the facebox action but a div that has rel="facebox" in it).
Any insight would be greatly appreciated as I am at the point of giving up on facebox. What other scripts are available that can do the same thing with nice rounded corners AND can survive dynamic changes to the divs that use it?
I've attached lookingforbug.js, and of course you'd need the small facebox package too. To see the bug just uncomment the commented out line the js that reads teeCells.innerHTML = inStr; I can't seem to attach my html (what's with that) so here it is:
Thanks in advance for any insight...Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Facebox Problem Demo</title> <script src="facefiles/jquery-1.2.2.pack.js" type="text/javascript"></script> <link href="facefiles/facebox.css" media="screen" rel="stylesheet" type="text/css" /> <script src="facefiles/facebox.js" type="text/javascript"></script> <script type="text/javascript"> jQuery(document).ready(function($) { $('a[rel*=facebox]').facebox() }) </script> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <script src="JS/lookingforbug.js" type="text/javascript"></script> </head> <body onLoad="gettingLoaded_notable()"> <div id="fullcontainer"> <div id="mydiv" style="display:none"> This is the contents of a hidden DIV on the page, with ID="mydiv" and style set to "display:none"<br /><br /> <a href="http://www.dynamicdrive.com/dynamicindex4/facebox/index.htm">Facebox image and content viewer (v 1.1)</a> </div> <!-- end hidden div --> <!-- here's the div we try to work with using innerHTML but even just getting the innerHTML and then setting it right back without changing it breaks the facebox popup --> <div id="teedisplay" width="850" border="0" style="background-color:white;"> <div> <p><a href="#mydiv" rel="facebox">View DIV with id="mydiv" on the page</a></p></div> </div> </div> <!-- end fullcontainer--> </body> </html>



Reply With Quote

Bookmarks