使用jQuery隐藏跨度 [英] Hide span using jQuery

查看:119
本文介绍了使用jQuery隐藏跨度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即使已经有嵌入式图像,如果没有文本,如何隐藏跨度? 基本上,每个跨度中都很少嵌入这样的Web图标和视频图标.

How to hide span if there is no text even though there already is an embedded image? Basically there are little web icon and video icon embedded like this in each span..

访问网站(webicon)查看视频(videoicon) 因此,如果---- no link text ---(EMBEDDED WEBICON),则包括图像图标在内的所有内容都应隐藏..

Visit website(webicon) View Video(videoicon) so if ----no link text---(EMBEDDED WEBICON), the whole thing including the image icon should hide..

<div class="profile-links">
     <!--visit website,watch video links-->
     <span class="website"><SharePointWebControls:UrlField FieldName="VISIT WEBSITE" runat="server">
     </SharePointWebControls:UrlField></span> <img class="website" src="/Style Library/Images/design/icons/icon-www.png" alt="WebSite" />
     &nbsp;&nbsp;
     <span class="video"><SharePointWebControls:UrlField FieldName="WATCH VIDEO" runat="server">
     </SharePointWebControls:UrlField></span><img src="/Style Library/Images/design/icons/icon-video-teal.png" alt="Video" />                                                    
</div>

推荐答案

这将使用网站"类隐藏所有span元素:

This will hide all of the span elements with a class of 'website':

$(function() {
    $('span.website').hide();
});

这篇关于使用jQuery隐藏跨度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆