You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
I have frameset with 2 frames in one of which I have a drop down menu which is made up of a <div> with style="position:absolute".
The problem is that the div will go under the frame border and will not appear on top. Is there any solution to avoid this?
Hi,
You've to use iframe and set the size and position of it as the same as the div you've used for menu, and set the z-index of the iframe one less than the div so that it comes under the div and div gets displayed on top of it.
I don't know if I got it right but I tried following your recommendation (with no success). The 2 html pages below are the 'frameset page' and the 'left frame'(test.html) respectively. Opening the first page you will notice that the contents of the div will go under the frameset border...
<html>
<head>
</head>
<body>
<iframe style='position:absolute;top:10px;left:10px;z-index:4' height='150px' width="150px">
</iframe>
<div id ='menu'
style='position:absolute;top:10px;left:10px;z-index:5;height:150px;width:150px' >
This text goes under the frame border
</div>
</body>
</html>
How shall I prevent the 'menu' DIV to go under the frame border(And it is not my choice to use iframe instead of frameset).