Posted By

rolandog on 07/10/06


Tagged

fix javascript html xhtml litebox images


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

rolandog
kgosser


Make LiteBox work for application/xhtml xml and text/html


 / Published in: JavaScript
 

Directions: be sure to set to absolute paths every image location from your litebox-1.0.js and lightbox.css files... and, replace the setInnerHTML function with this one... http://www.doknowevil.net/litebox/

  1. // http://www.doknowevil.net/litebox/
  2. setInnerHTML: function(element,content) {
  3. element = $(element);
  4. if(element.hasChildNodes()) {
  5. element.removeChild(element.firstChild);
  6. }
  7. content = document.createTextNode(content);
  8. element.appendChild(content);
  9. }

Report this snippet  

You need to login to post a comment.