We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


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.