• Resolved timholz

    (@timholz)


    Hi
    Before i installed AO i enqueued scripts and styles for wp-mediaelements conditionally, just for the few posts where i needed them (audio mainly). Now, since i have AO installed, i observe a strange behaviour.
    Sometimes the medieplayer is not styled correctly and the bars are over a 1000 pixels wide. After a refresh everything is back to normal.
    I omitted all conditions for the scripts and styles and since then the behaviour is good again, but of course the AO pack gets heavier.

    Is conditionally loading ok with AO, or am i doing something wrong with enqueuing my scripts and styles?

    Thanks a lot for your time and interest.
    regards
    theo

    https://www.ads-software.com/plugins/autoptimize/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Frank Goossens

    (@futtta)

    if a simple page refresh fixes the problem, then your conditional enqueuing probably isn’t the issue here. any errors in your browser console? as you only have few pages with audio, you could also exclude the mediaelements from autoptimization?

    frank

    Thread Starter timholz

    (@timholz)

    Hi Frank
    The problem is solved. My mistake.
    I enqueued the styles after the script. I guess that was the cause.
    After changing the order, it seems to load correctly.
    Sorry for the trouble.

    Have a pleasant day
    theo

    Plugin Author Frank Goossens

    (@futtta)

    Goodie!

    frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘conditionally enqueuing scripts and styles’ is closed to new replies.