codyhouse / cd-draggable-image-gallery-changelog

Report issues and get notified about changes affecting the 'Draggable Image Gallery' component.
https://codyhouse.co/ds/components/app/draggable-image-gallery
0 stars 0 forks source link

Draggable gallery only kicks in on page/window resize - not on initial page load - as per someone else's issue #3

Open richardwiggins opened 10 months ago

richardwiggins commented 10 months ago

I'm using this in several places on a new website and find it doesn't work a lot of the time.

If I resize the screen it instantly fixes it though.

You can see this happening here and here.

I'm using 3.0.14:

"devDependencies": { "autoprefixer": "^9.4.3", "browser-sync": "^2.26.3", "codyhouse-framework": "^3.0.14", "gulp": "^4.0.0", "gulp-clean-css": "^4.3.0", "gulp-concat": "^2.6.1", "gulp-postcss": "^8.0.0", "gulp-purgecss": "^3.0.0", "gulp-rename": "^1.4.0", "gulp-sass": "^5.0.0", "gulp-sass-glob": "git+https://github.com/CodyHouse/gulp-sass-glob.git", "gulp-uglify": "^3.0.2", "postcss-calc": "^7.0.1", "postcss-css-variables": "git+https://github.com/CodyHouse/postcss-css-variables.git", "sass-embedded": "^1.69.5" }

claudia-romano commented 10 months ago

Hi Richard, are your images created dynamically (e.g., retrieved from a database)? If this is the case, then make sure the component is initialised after the img elements are created in your HTML. This will fix your issue.

richardwiggins commented 10 months ago

Hey,

They are so I guess maybe that’s the issue.

Any tips on how to achieve that?

On 6 Dec 2023, at 09:41, Claudia Romano @.***> wrote:

Hi Richard, are your images created dynamically (e.g., retrieved from a database)? If this is the case, then make sure the component is initialised after the img elements are created in your HTML. This will fix your issue.

— Reply to this email directly, view it on GitHub https://github.com/codyhouse/cd-draggable-image-gallery-changelog/issues/3#issuecomment-1842525382, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHFQD7KDFIFWVV6NA532O3YIA4UFAVCNFSM6AAAAABABFAYCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBSGUZDKMZYGI. You are receiving this because you authored the thread.

claudia-romano commented 9 months ago

Thanks for the update. The easiest way would be to trigger a window resize once all the images have been loaded.