Reveal.js: Question: Updating background attributes dynamically

Created on 18 Jul 2014  路  1Comment  路  Source: hakimel/reveal.js

I love reveal, but I'm having a bit of an issue with dynamically updating/replacing background images and colours on slides.

I have tried changing the data-background-image attribute on my section and calling Reveal.initialize(), but to no avail -- the background remains the same colour as when I did the first init. I event went so far as to remove the .backgrounds div to hope to force a re-rendering, but it was re-populated with the old values when i reinitialized.

Seems like the only way I've found that works is refreshing the whole page.

Could someone point me to a method of updating background attributes for slides dynamically, without refreshing the page?

Thanks!

Most helpful comment

Calling Reveal.sync() will recreate the backgrounds based on the current attributes in the DOM.

>All comments

Calling Reveal.sync() will recreate the backgrounds based on the current attributes in the DOM.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

togakangaroo picture togakangaroo  路  4Comments

nedbat picture nedbat  路  3Comments

ablakey picture ablakey  路  3Comments

deisi picture deisi  路  4Comments

OscarDeDios picture OscarDeDios  路  3Comments