Why does my HTML menu popup display UNDERNEATH my silverlight control?
We have a web page with an iFrame (that points to a web page that contains a silverlight control). For example:
<iframe src="http://www.mysite.com/MyFancySilverlightHost.aspx" width="950px" height="600px"
style="z-index: 1;"></iframe>
The problem is that we have a dropdown menu right above this control, and the menus开发者_如何学C display BELOW the silverlight control. We would like the menus to display over the silverlight control. Is this possible?
I have tried setting the z-index on the menu to a large number like 1000, but this has no effect.
PS: I have confirmed this in Chrome and IE8. (firefox works fine!)
Any ideas?
This was actually a problem on the WindowLess property of the tag that was hosting the silverlight control. When setting this to True, it works like a charm. The HTML hovers over the iFrame and over the Silverlight conrol.
The problem isn't Silverlight, it's the iframe. The iframe is treated like another window, so if it will block anything on the page underneath it. The z-index on the iframe really has no effect.
Can you just embed your silverlight object on the page instead of using the iframe?
Or, you could modify your menu to have an iframe under it as well, then you would be able to use z-index to get it in front. This is similar to the hack necessary to get z-index to place elements above select boxes in IE6.
精彩评论