amandablum / mindup

1 stars 0 forks source link

responsive menu appears behind video in IE, not visible #114

Closed amandablum closed 8 years ago

amandablum commented 8 years ago

can this be solved w z-index?

amandablum commented 8 years ago

the issue is that the youtube video must have ?wmode=transparent amended to end. Have tested, and it works. I know this comes in via oembed. Doing more research.

amandablum commented 8 years ago

solution: https://wordpress.org/support/topic/help-adding-wmodetransparent-to-oembeds

this amends oembeds to replace oembed parameter (not needed) with transparent parameter above. 
add_filter( 'the_content' , 'mh_youtube_wmode' , 15 );

function mh_youtube_wmode( $content ) {

// Regex to find all <ifram ... > YouTube tags
$mh_youtube_regex = "/\<iframe .*youtube\.com.*><\/iframe>/";

// Populate the results into an array
preg_match_all( $mh_youtube_regex , $content, $mh_matches );

// If we get any hits then put the update the results
if ( $mh_matches ) {;
        for ( $mh_count = 0; $mh_count < count( $mh_matches[0] ); $mh_count++ )
                {
                // Old YouTube iframe
                $mh_old = $mh_matches[0][$mh_count];

                $mh_new = str_replace( "?feature=oembed" , "?wmode=transparent" , $mh_old );
                $mh_new = preg_replace( '/\><\/iframe>$/' , ' wmode="Opaque"></iframe>' , $mh_new );

                // make the substitution
                $content = str_replace( $mh_old, $mh_new , $content );
                }
        }
return $content;
}
amandablum commented 8 years ago

dear client: use vimeo because better.