Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

HTML classes revert on passage load? (Solved)

edited March 2014 in Help! with 1.x
I am setting up some various classes via script such as changing <body> to <body class="white"> or something similar. This all works fine... but then when a passage link is clicked, the class value is dropped. I want it to persist. I set a function to sort out what it was and reinstate it as soon as the passage loads, but this causes a "flicker"... I really want it to not change back. Any way to do this?

Comments

  • Can you post a TWS or HTML file?
  • [I'm assuming you're using SugarCube]

    Classes on the body element are reset upon passage display for various reasons, so you'll have to (re)apply any class modifications each time.  The normal way that this is done is via the PassageReady special passage, which should rid you of any "flicker".
  • TheMadExile wrote:

    [I'm assuming you're using SugarCube]

    Classes on the body element are reset upon passage display for various reasons, so you'll have to (re)apply any class modifications each time.  The normal way that this is done is via the PassageReady special passage, which should rid you of any "flicker".


    Thank you! That was the answer. I had to define the script within PassageReady though, to avoid an error message popping up on the Start passage... but yep, being able to affect things at PassageReady allowed me to set things up before anything else happened, and in this case eliminate the flicker :)
Sign In or Register to comment.