I'm working with the mediaelement.js CSS in WordPress and noticed a style attribute is being added to my .mejs-container element. I assume this is being added via JavaScript because the width and height values seem to be dynamic.

This is what is being output in my source:

<div id="mep_0" class="mejs-container svg mejs-audio" tabindex="0" role="application" aria-label="Audio Player" style="width: 453px;height: 62px;">

I tried writing some CSS to override but the style attribute is taking precedence so this approach doesn't work:

.mejs-container {
    height: 0;
    width: 0;

How can I stop this style attribute being added?

  • Try to remove the event listener Jun 2, 2017 at 8:56
  • Can you give an example? Jun 2, 2017 at 9:15

1 Answer 1

    $('audio,video').mediaelementplayer({features: ['playpause','progress','current','duration','tracks','volume','fullscreen']});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.