jQuery, bgiframe and IE6 z-order hacks
Well, it probably looks like an odd title. But let’s face it: we still have to support IE6 for some of our clients no matter how much we don’t like it or it shouldn’t be. And one of the most frustrating items that we ever had to support in IE6 is the fact that certain controls and plug-ins don’t obey z-order.
What this means in a practical sense is that if we have a menu layer that drops over one of these misbehaving bad boys, we have to find some hack around it.
The problem I had to solve is that the code for this project is done. There isn’t a lot of room for tweaking. The menu we are using is something that is not going to be modified easily. So, any solution I came up with had to “plug in” to what we already had.
Sounds like a job for jQuery to me.
I did find a solution that claimed it would do the trick: bgiframe. But of course you notice that qualifier, “claimed.” Yes folks, I had trouble getting it to work.
What exactly does bgiframe do? It scripts the iframe hack into your popover layer.
You see, our menu system is based on a styled, unordered list. When I told bgiframe to grab the UL and put the iframe in it, it just didn’t work. Oh, it put the iframe in. But the select windows still showed through.
What was odd was that even the iframe was transparent. Odd, I thought. It isn’t supposed to be transparent.
So after half a day of searching, looking at the source for bgiframe, and generally pulling my hair out, I finally remembered seeing this little “hack” for the src property of the iframe. It’s actually noted in the link to the iframe hack I have above.
The iframe code should look like:
<iframe src="BLOCKED SCRIPT'<html></html>';" scrolling="no" frameborder="0" ...
But the script that bgiframe produces looks like:
<iframe src="javascript:false;" scrolling="no" frameborder="0" ...
the src=”javascript” thing works most of the time. In fact, I kind of got everything working by putting the iframe arount the LI tags instead of around the UL tag. Only I had some other issues when I did that, and it is a sub-optimal way of getting this all working. Hack of a hack.
Now, I fixed this by changing the bgiframe source. But if you don’t want to be that intrusive, you can just call bgiframe using the src parameter.
$("ul").bgiframe({ src: "BLOCKED SCRIPT'<html></html>';" });
Other post in jQuery
- jQuery - The Man, The Myth, The Legend - October 8th, 2008
- Getting started with jQuery and ASP.NET - October 15th, 2008
- jQuery - Explaining Last Week's Code - October 21st, 2008
- Friday Books - "Learning jQuery" - October 24th, 2008
- jQuery Simple Selectors - October 28th, 2008
- Friday Books - "jQuery in Action" - October 31st, 2008
- jQuery Selectors - Looks just like CSS - November 6th, 2008
- VS2008 SP1 Hotfix to Support "-vsdoc.js" IntelliSense Doc Files - November 11th, 2008
- jQuery Looks like XPath - November 12th, 2008
- jQuery - class manipulation - November 19th, 2008
- jQuery - Events - December 2nd, 2008
- Host jQuery at Google (with Intellisense support) - December 10th, 2008
- jQuery - Calling Your Own Functions - December 16th, 2008
- Friday Books - jQuery Reference Guide - December 19th, 2008
- jQuery - Creating Plug-ins - December 23rd, 2008
- jQuery - Loading Partial Content - December 30th, 2008
- jQuery - Positioning Elements - January 6th, 2009
- AjaxToolKit TabControl Disabled Tab - January 12th, 2009
- jQuery, JSON, and ASP.NET - January 15th, 2009
- Review of the MDC at NYC - January 21st, 2009
- jQuery - Retrieving HTML Fragments - January 22nd, 2009
- jQuery GUI - Drag - February 3rd, 2009
- jQuery - Drop - February 12th, 2009
- jQuery UI - Resizable w/ ASP.NET Themes - February 18th, 2009
- jQuery, bgiframe and IE6 z-order hacks - February 19th, 2009
- jQuery - Sliders (scrollbars to the rest of us) - March 4th, 2009
- jQuery - Using Slider as a Scrollbar - March 12th, 2009
- jQuery - Auto Scrolling the Slider - March 23rd, 2009
- Live Presentation of jQuery - March 23rd, 2009
- Just a Week Away! - April 7th, 2009
- jQuery Tabs - April 9th, 2009
- jQuery Demos From Last Tuesday’s Presentation - April 16th, 2009
- jQuery – Accordion - May 6th, 2009
- CustomValidationControl and jQuery - May 11th, 2009
- Mixing ASP.NET, jQuery and JSON - May 12th, 2009
- jQuery Progressbar - May 20th, 2009
- jQuery – Dialog - June 2nd, 2009
- jQuery – Modal Dialog - June 9th, 2009
- Does jQuery Make Us Lazy? - June 18th, 2009
- jQuery Dialog – With Validation Controls - June 25th, 2009
- jQuery – Date Picker - July 2nd, 2009
- jQuery Splitter - July 21st, 2009
- jQuery Expand/Collapse Using Head Tags - October 15th, 2009
- Do you Need My Help? - November 18th, 2009
- Flash to jQuery - November 30th, 2009
- JQuery, Cufon, and Dynamic Content - December 1st, 2009
- jQuery, Each() and Async Gets - December 2nd, 2009
- jQuery and ASP.NET UpdatePanel - January 6th, 2010
- jQuery 1.4 Released - January 15th, 2010
Other Related Items:
Cheese and Sausage Select Gift BoxThe Cheese and Sausage Select Gift Box from Figi's has been a been a family gift favorite for over 40 years. This gourmet cheese and sausage assortme... Read More >
FiresRe-issue on 14th floor recordings. Nerina Pallot is a phenomenon. Her Classical music training belies her background and her influences. Fires kicks o... Read More >










