December 30, 201510 yr Can someone tell me what I did wrong, why this works when you click on an image, but not on this page ? I simply copied and pasted the code as so it's identical but the CodePen version works, the other, well, not. Edited December 30, 201510 yr by CreativeSheep
December 30, 201510 yr First, I would check on the notices in the JavaScript console — the dialog-polyfill.js file is 404ing. Also, try moving your <script></script> from the header to some place below that JavaScript file. (Just above the closing </body> tag should work well.)
December 30, 201510 yr Author First, I would check on the notices in the JavaScript console — the dialog-polyfill.js file is 404ing. Also, try moving your <script></script> from the header to some place below that JavaScript file. (Just above the closing </body> tag should work well.) Why is it referencing the file to another link, when I removed all references to the link ? My reference to the script is, as you mentioned, strictly above the closing tag of the </body> tag ?
December 30, 201510 yr Can someone tell me what I did wrong, why this works when you click on an image, but not on this page ? I simply copied and pasted the code as so it's identical but the CodePen version works, the other, well, not. In the CodePen version, the script is running at the bottom of the page. In your version, it's at the top in the <head> section. You're attempting to call a function on an element that hasn't been rendered yet. If using jQuery, wrap your function in a document ready to ensure the element exists when you're calling it. Alternatively, move your script to the bottom of the page, before the closing </body> tag (it's better down here anyway - the browser won't get interrupted by it rendering). Hope this helps.
December 30, 201510 yr Author Ahh I see the error of my ways. In my version it is working but the lightbox is not clearly visible ? Chrome works, ok, except the close button is out of view, Firefox 43.0.3 has problems. Edited December 30, 201510 yr by CreativeSheep
December 30, 201510 yr Author <img src="http://demosthenes.info/assets/images/sossusvlei-namibia-thumb-1x.jpg" srcset="sossusvlei-namibia-thumb-1x.jpg 1x, http://i4.mirror.co.uk/incoming/article5803160.ece/ALTERNATES/s615/Lion-park.jpg w320 " The image in red is initially seen by the user, shouldn't the image in blue be seen when the viewport is a width of 320 ? Edited December 30, 201510 yr by CreativeSheep
Create an account or sign in to comment