{"comment":{"created_at":"2011-10-10T00:14:48Z","body":"Can you please check out http://www.n9na.com/test.html - it is not working in IE8+IE7 for some reason...any idea?","updated_at":"2011-10-10T00:14:48Z","url":"https://api.github.com/repos/codecomputerlove/PhotoSwipe/issues/comments/2341932","id":2341932,"user":{"avatar_url":"https://secure.gravatar.com/avatar/06b0dc65df63cc4b9740029d29e93379?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/paviod","id":542361,"login":"paviod"}},"action":"created","issue":{"number":152,"created_at":"2011-10-06T17:22:16Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi all, can someone please help me convert this call into a jquery so it will work across all browsers. Right now it doesn't work for IE. It would be a great help!\r\n\r\n```jacascript\r\n<script type=\"text/javascript\">\r\n\r\n\t\t(function(window, PhotoSwipe){\r\n\t\t\r\n\t\t\tdocument.addEventListener('DOMContentLoaded', function(){\r\n\t\t\t\r\n\t\t\t\tvar\r\n\t\t\t\t\toptions =  {\r\n\r\n\r\n\t\t\t\t\t\tgetImageCaption: function(el){\r\n\t\t\r\n\t\t\t\t\t\t\tvar captionText, captionEl;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Get the caption from the alt tag\r\n\t\t\t\t\t\t\tif (el.nodeName === \"IMG\"){\r\n\t\t\t\t\t\t\t\tcaptionText = el.getAttribute('alt'); \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvar i, j, childEl;\r\n\t\t\t\t\t\t\tfor (i=0, j=el.childNodes.length; i<j; i++){\r\n\t\t\t\t\t\t\t\tchildEl = el.childNodes[i];\r\n\t\t\t\t\t\t\t\tif (el.childNodes[i].nodeName === 'IMG'){\r\n\t\t\t\t\t\t\t\t\tcaptionText = childEl.getAttribute('alt'); \r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Return a DOM element with custom styling\r\n\t\t\t\t\t\t\tcaptionEl = document.createElement('div');\r\n\t\t\t\t\t\t\tcaptionEl.style.cssText = 'color:white; font-weight: bold; padding: 5px;';\r\n\t\t\t\t\t\t\tcaptionEl.appendChild(document.createTextNode(captionText));\r\n\t\t\t\t\t\t\treturn captionEl;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Alternatively you can just pass back a string. However, any HTML \r\n\t\t\t\t\t\t\t// markup will be escaped\r\n\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t},\r\n\t\t\t\t\tgallery1Instance = PhotoSwipe.attach( window.document.querySelectorAll('a.affari'), { slideSpeed:500,captionAndToolbarAutoHideDelay:0 } ),\r\n\t\t\t\t\tgallery2Instance = PhotoSwipe.attach( window.document.querySelectorAll('a.calasole1'), { slideSpeed:500,captionAndToolbarAutoHideDelay:0  } ),\r\n\t\t\t\t\tgallery3Instance = PhotoSwipe.attach( window.document.querySelectorAll('a.calasole2'),{ slideSpeed:500,captionAndToolbarAutoHideDelay:0  }  ),\r\n\t\t\t\t\tgallery4Instance = PhotoSwipe.attach( window.document.querySelectorAll('a.goop'), { slideSpeed:500,captionAndToolbarAutoHideDelay:0  } ),\r\n\t\t\t\t\tgallery5Instance = PhotoSwipe.attach( window.document.querySelectorAll('a.calasole3'), { slideSpeed:500,captionAndToolbarAutoHideDelay:0  }  ),\r\n\t\t\t\t\tgallery6Instance = PhotoSwipe.attach( window.document.querySelectorAll('a.davai1'), { slideSpeed:500,captionAndToolbarAutoHideDelay:0  }  ),\r\n\t\t\t\t\tgallery7Instance = PhotoSwipe.attach( window.document.querySelectorAll('a.dieli'), { slideSpeed:500,captionAndToolbarAutoHideDelay:0  }  ),\r\n\t\t\t\t\tgallery8Instance = PhotoSwipe.attach( window.document.querySelectorAll('a.lepanto'), { slideSpeed:500,captionAndToolbarAutoHideDelay:0  }  ),\r\n\t\t\t\t\tgallery9Instance = PhotoSwipe.attach( window.document.querySelectorAll('a.bisazza1'), { slideSpeed:500,captionAndToolbarAutoHideDelay:0  }  );\r\n\t\t\t\r\n\t\t\t}, false);\r\n\t\t\t\r\n\t\t\t\r\n\t\t}(window, window.Code.PhotoSwipe));\r\n\t\t\r\n\t</script>\r\n```","comments":3,"title":"Convert to JQuery so it works in IE7+","updated_at":"2011-10-10T00:14:48Z","url":"https://api.github.com/repos/codecomputerlove/PhotoSwipe/issues/152","id":1835895,"assignee":null,"milestone":null,"closed_at":"2011-10-08T13:37:51Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/06b0dc65df63cc4b9740029d29e93379?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/paviod","id":542361,"login":"paviod"},"html_url":"https://github.com/codecomputerlove/PhotoSwipe/issues/152","labels":[{"name":"Implementation Question","url":"https://api.github.com/repos/codecomputerlove/PhotoSwipe/labels/Implementation+Question","color":"02d7e1"}],"state":"closed"},"legacy":{"issue_id":1835895,"comment_id":2341932}}