$('iframe').css('visibility','hidden') not working in Google chrome

前端 未结 3 1986
花落未央
花落未央 2020-12-17 22:28

I am using something like

$(\'ul li\').find(\'iframe\').css({\'visibility\':\'visible\'});

which works fine In Firefox and Opera,

cons

相关标签:
3条回答
  • 2020-12-17 23:12

    The object map should work just fine but if you're only setting a single style it may be easier to skip the object map completely. Try this:

    $('ul li').find('.titThumb').css('visibility', 'visible');
    $('ul li').find('.titIframe').css('visibility', 'hidden');
    

    http://api.jquery.com/css/

    0 讨论(0)
  • 2020-12-17 23:18

    There are issues with actually making iframes invisible (i.e. using visibility:hidden or display:none). But you can make them disappear by being small enough

    $('ul li').find('iframe').css({"height":"0", "width":"0", "border":"none"});
    
    0 讨论(0)
  • 2020-12-17 23:28

    I know this is a bit dated, but I just ran into the same problem. My solution was

    css( 'opacity', 0 )
    
    0 讨论(0)
提交回复
热议问题