user2768683
user2768683

Reputation: 39

Div getting hide behind flash content

I want to show a previous and next div over flash content which is opening in iframe.I have tried all the wmode=opaque or wmode=transparent or wmode=window, but fail to work in IE8.

I can't add because flash content is coming from other site. I am loading the other site in iframe.

Upvotes: 3

Views: 127

Answers (2)

gvee
gvee

Reputation: 17171

DEMO: http://jsfiddle.net/pjgxt/2/

HTML

<div id="container">
    <div class="controls prev">prev</div>
    <iframe src="//www.youtube.com/embed/PbsaHzIokEE" frameborder="0" ></iframe>
    <div class="controls next">next</div>
</div>

CSS

#container {
    position: relative;
    width: 400px;
    padding-left: 100px;
    padding-right: 100px;
    border: 1px solid red;
}

.controls {
    position: absolute;
    width: 100px;
    height: 100px;
    top: 50px;
    background-color: lime;
    z-index: 10;
}

.prev {
    left: 50px;
}
.next {
    right: 50px;
}

iframe {
    width: 100%;
    height: 200px;
    position: relative;
    z-index: 5;
}

Notes

  • z-index controls the layering of elements.
  • You can only apply a z-index to elements that have a position of relative or absolute.

Upvotes: 3

Deep Sharma
Deep Sharma

Reputation: 3483

try it with giving z-index property to div

Upvotes: 0

Related Questions