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

前端 未结 3 1988
花落未央
花落未央 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/

提交回复
热议问题