使LiteBox适用于application/xhtml和text/html

【使LiteBox适用于application/xhtml和text/html】智者不为愚者谋,勇者不为怯者死。这篇文章主要讲述使LiteBox适用于application/xhtml和text/html相关的知识,希望能为你提供帮助。
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. }


    推荐阅读