JQ判断div是否为空,js根据时间显示广告位(工作笔记)

Jquery判断div是否为空,为空就隐藏

最近的一个项目笔记JQ判断div是否为空,javascript根据当前时间来显示广告需要的朋友可以参考一下

1.html

<li class="img1" style="background:red; height:100px">
                                    <ul  style="background:red; height:50px; background:#000">    </ul>
                            </li>
            <li class="img1" style="background:#ccc; height:100px">
                                    <ul>
                                   </ul>
                            </li>    

2.jquery

		 $(document).ready(function () {
			  $(".img1 ul").each(function(){
				  var t = $(this).html();
				  t = t.replace(/s/g,"").replace(/ /g,""); //换行替换为空
				  if(t == ''){
						$(".img1 ul").parent().css("display","none"); //这个也是隐藏
						//$(this).parent().hide();
				  }
			  });
		  });	

javascript根据当前时间来显示广告

javascript根据当前时间来显示广告【根据时间来判断】

[runcode height=”300″]



首页-广告640×100




javascript根据当前时间来显示广告【根据星期来判断】

[/runcode]

[runcode height=”300″]



首页-广告640×100



广告位1
广告位2
广告位3



[/runcode]

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇