954,598 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

IE7/8: div loses :hover if mouse moves over an iframe which is inside the div!

I'm trying to add faceboock "like button" and twitter "tweet button" on a list, my list structure is:

<list>
    <listItem>
        <iframeContainer>
            <iframe/>
        </iframeContainer>
    </listitem>
</list>

css is:

listItem iframeContainer {display:none;}
listItem:hover iframeContainer {display:block;}


the problem is when mouse moves over the the loses its focus.

I tried to fix it by csshover.htc but it doesn't fix it.

It works fine in other browsers.

you can check it out live here: http://bit.ly/hsFtq6
you need to signup at website, it's easy and fast!

thanks

behzad.gh
Newbie Poster
2 posts since Dec 2010
Reputation Points: 34
Solved Threads: 0
 

I've fixed the problem by the same way as csshover.htc though adding csshover.htc didn't fix it!

if($.browser.msie){
     $('.item').live('mouseenter',function() {
        $(this).addClass('hover');
     });
     $('.item iframe').live('hover',function() {
        $(this).parents(".item").addClass('hover');
     });
     $(".item").live('mouseleave',function() {
        $(this).removeClass('hover');
     });
}

css:

.item:hover, .item.hover {background-color:#555;}
behzad.gh
Newbie Poster
2 posts since Dec 2010
Reputation Points: 34
Solved Threads: 0
 

Hi,

Thanks so much for providing the solution :) I've marked this thread as solved.

In the future, when your question requires us to look at a live demo, try to provide a version of the demo that is not behind a wall. It will increase your response rate :)

cscgal
The Queen of DaniWeb
Administrator
19,437 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 231
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: