Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Image pop up differences

Featured Replies

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 by CreativeSheep

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.)

  • 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 ?

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.

  • 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 by CreativeSheep

  • 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 by CreativeSheep

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.