jQuery: The Write Less, Do More JavaScript Library

bgiframe & superfish

View: New views
4 Messages — Rating Filter:   Alert me  

bgiframe & superfish

by rolfsf-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I've been implementing a menu with the superfish menu, and have been
troubleshooting IE (as usual). I'm using the bgiframe plugin as
prescribed in the superfish documentation.

$(document).ready(function(){
        $("ul.nav")
        .superfish({
                animation : { opacity:"show", height:"show" }
        })
        .find(">li:has(ul)")
                .mouseover(function(){
                        $("ul", this).bgIframe({opacity:false});
                })
                .find("a")
                        .focus(function(){
                                $("ul", $(".nav>li:has(ul)")).bgIframe({opacity:false});
                        });
});

When I use IE's DOM Explorer to look at the menu, I notice that
bgiframe is placing the iframe inside the UL, like this

<ul class="sfHover">
    <iframe class="bgiframe"></iframe>
    <li></li>
    <li></li>
</ul>

Isn't that invalid? Shouldn't the iframe be wrapping the UL?

it just doesn't look right - am I crazy?

rolfsf


Re: bgiframe & superfish

by Joel Birch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Yes, that is invalid HTML. It is inserted in that position so that it
is "behind" the actual ul contents (the li elements). I guess the
resulting invalid HTML is a consequence we accept in exchange for a
much-needed fix for the IE bug. That said, bgIframe does not affect
IE7 or above, so I think it is not something worth worrying about. In
my opinion, IE6 is so broken that anything goes when it comes to bug
fixes. As long as the result is that it works like more modern
browsers, then personally I'm prepared to live with that and look
ahead to (hopefully) improved versions of IE.

Joel Birch

Re: bgiframe & superfish

by Joel Birch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


By the way, you only want to use bgIframe with Superfish if you expect
the submenus to overlap select elements.

Re: bgiframe & superfish

by rolfsf-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I understand... I had just assumed (without thinking!) that the iframe
was wrapped around the ul. I was having some problems in IE that
seemed to be coming from the use of bgiframe. I've since looked
through the entire set of screens and determined that I can probably
get away with not using it (we've got about 70% IE6, unfortunately),
which gets me past the issues for now. Thanks.

On May 14, 12:16 am, "Joel Birch" <joeldbi...@...> wrote:

> Yes, that is invalid HTML. It is inserted in that position so that it
> is "behind" the actual ul contents (the li elements). I guess the
> resulting invalid HTML is a consequence we accept in exchange for a
> much-needed fix for the IE bug. That said, bgIframe does not affect
> IE7 or above, so I think it is not something worth worrying about. In
> my opinion, IE6 is so broken that anything goes when it comes to bug
> fixes. As long as the result is that it works like more modern
> browsers, then personally I'm prepared to live with that and look
> ahead to (hopefully) improved versions of IE.
>
> Joel Birch