views:

30

answers:

2

Hi,

I'm using jwplayer in html tabs in IE with jqery showing and hiding them (via style:hidden;)

When I hide a tab in IE and then show it again the plays video area goes blank (you can still hear sound and play/pause the video).

Does anyone know why this is happening or have a way to fix it.

Cheers.

Here's the jQ doing the hiding / showing:

function showpanel(panel){
  jQuery('#announcements .panel').each(function(index) {
    if(panel == index) {
      jQuery(this).css('visibility','visible');
    } else {
      jQuery(this).css('visibility','hidden');
    }
  });
  jQuery('#announcements .nav ul li.item').each(function(index) {
    if(panel == index) {
      jQuery(this).addClass("active");
    } else {
      jQuery(this).removeClass("active");
    }
  });  
}
jQuery(document).ready(function(){
showpanel(0);
  jQuery('#announcements .nav ul li.item').each(function(index) {
      jQuery(this).mouseover(function(){
                    if(jQuery(this).hasClass("active")){                           
             //console.log('if'); 
                    } else {  
                        //console.log('else');
                        document.getElementById('jw_player').sendEvent('PLAY', 'false');
                        showpanel(index);
                    }
                });
  });
});
A: 

look at this http://stackoverflow.com/questions/2731876/jw-player-cross-browser-displaynone-player-behavior

Andy Lin
I think the issue is a little different....
Smickie
sorry, read again, it is different questiondo you have the snippet of code to let me have a try?
Andy Lin
jquery's hide and show with JWPlayer works on mine IE7/8 ...
Andy Lin
sure thing! I've added the function that's doing the hiding and showing.
Smickie
would you try 1. jquery's hide and show function, which is based on "display:none", like $('.element-to-hide').hide() and $('#element-to-show').show().2. or test with .css("display:none")
Andy Lin
A: 

I used...

if(panel == index) {
      jQuery(this).css('z-index','2');
    } else {
      jQuery(this).css('z-index','1');
    }

Instead of the visibility and it worked great.

Smickie