如果井号显示在网页上的任何位置,则显示某些内容
Show certain content if a pound sign shows anywhere on the web page
我们创建了以下内容,以便在我们的网站上查找国旗,并在我们的网站上显示某些国家/地区的国旗时显示消息。
我想调整它以在下面显示消息,除非页面上的任何地方显示井号 (£)。我该怎么做?非常感谢
<p id="checkout_notification_text" style="display:none;margin-top:-7px;"><b>As you are viewing prices in a currency other than GBP, prices shown will be converted into GBP by your card processor. This card processor <i>may</i> add a currency conversion fee of up to 2.5%.</b></p>
<script type="text/javascript">
var flg =readCookie("currencyflag");
if (!flg) {
$("dl.CurrencyList").children().eq(0).find("img").each(function(){
flg =$(this).attr("src");
});
}
if(flg) {
var flgImgArray = flg.split("/");
var flgImg = flgImgArray[flgImgArray.length-1];
if(flgImg != 'gb.gif'){
$('#checkout_notification_text').show();
}else{
$('#checkout_notification_text').hide();
}
}
</script>
我现在使用的代码:
<p id="checkout_notification_text" style="display:none;margin-top:-7px;"><b>As you are viewing prices in a currency other than GBP, prices shown will be converted into GBP by your card processor. This card processor <i>may</i> add a currency conversion fee of up to 2.5%.</b></p>
<script type="text/javascript">
if ($("body:contains('£')").length) {
$('#checkout_notification_text').hide();
} else {
//it is not found
}
</script>
我认为您仍然想进行标记搜索,但如果找到£以始终隐藏标志
使用 jquery
http://jsfiddle.net/a4U5A/3/
if ($("body:contains('£')").length) {
$('#checkout_notification_text').hide();
} else {
//it is not found
}
相关文章:
- 如何在Simile展品地图中显示位置
- 在TWebBrowser(谷歌地图)中显示位置,而无需单击按钮
- 如何使用XML中的经度和纬度值在地图上显示位置
- Jquery下拉菜单位于幻灯片上方的一个显示位置
- 谷歌地图 API v3 未正确显示位置
- 必应地图未使用 asp.net MVC 显示位置
- 在地图上显示位置
- 使用移动网络应用程序在iphone地图上显示位置
- 栏杆4:单击链接后如何更改显示位置
- 如何在网站上向用户显示位置(国家)
- 在Firefox中显示位置栏
- 无法使用Javascript在谷歌地图中显示位置详细信息
- 如何在Google Maps Places API上突出显示位置
- 根据弹出窗口的显示位置动态更改弹出窗口的位置
- 拖放时显示位置和合计
- 显示位置的变化在谷歌地图上没有重新加载地图一次又一次
- takto显示位置固定
- 在Google Maps API的标记上显示位置信息
- 使用JavaScript检查是否显示位置栏(适用于Internet explorer)
- 如何修改jQuery输入的显示位置