Disable Lightbox View The Correct way

Update: Lightbox Effect is Offcially Disabled by Blogger. No Worries now.



Yesterday I shared a short code that somehow helped to deactivate and remove the lightbox view for images appearing on blogger blogs. However some of the technical problems linked with it was that you were asked to paste the code just below the closing body tag and technically speaking that is against W3C standards. This was one reason why some widgets and Adsense ads got effected and did not display correctly. I have found a much better way of dealing with this problem brought by blogger team and it is really easy to implement. So kindly delete the previous code that I earlier shared and follow this new one.








Disable Lightbox view in Blogger Easily



  1. Go To Blogger > Design

  2. Choose HTML/JavaScript Widget

  3. Paste the following code inside it



<script type="text/javascript">
//<![CDATA[
var lightboxIsDead = false;
function killLightboxundefined) {
if undefinedlightboxIsDead) return;
lightboxIsDead = true;
var images = document.getElementsByTagNameundefined'img');
for undefinedvar i = 0 ; i < images.length ; ++i) {
images[i].parentNode.innerHTML = images[i].parentNode.innerHTML;
}
}

if undefineddocument.addEventListener) {
document.addEventListenerundefined'DOMContentLoaded', killLightbox, false);
} else {
document.attachEventundefined'onDOMContentLoaded', killLightbox);
window.attachEventundefined'onload', killLightbox);
}
//]]>
</script>

     4.  Save the widget and drag the widget anywhere to the bottom

     5.   you are all done!



Now this was a much neater and cleaner way. Which will work without disturbing the flow of other gadget on your blog. Happy blogging. enjoy! :)



Code Credits:Englishjavadrinker