$("#dc div")意思為查找id值為dc這個容器中所有的div標簽

10年積累的網(wǎng)站設計制作、成都做網(wǎng)站經(jīng)驗,可以快速應對客戶對網(wǎng)站的新想法和需求。提供各種問題對應的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡服務。我雖然不認識你,你也不認識我。但先網(wǎng)站設計制作后付款的網(wǎng)站建設流程,更有樂陵免費網(wǎng)站建設讓你可以放心的選擇與我們合作。
這個就是一個層級的概念了
$("#dcdiv:first")這個就是說查找id值為dc這個容器中的直接div標簽(不包括其他標簽內(nèi)部的div標簽)
同時,咱們能看到還有一個:first,這個就是說只定位到第一個div標簽上面
div id="dc"
div name="1"/div
div name="2"
div name="3"/div
/div
/div
$("#dc div")要使用這個查找的話,他就能找到name=1 2 3這三個div
$("#dcdiv")要使用這個查找的話,他就能找到name=1 2這兩個div
$("#dcdiv:first")要是使用這個查找的話,他就只能找到 name=1的這個div了
您說的$("#dcdiv")或$("#dc=div")這兩種方法就是沒有的了,
因為在這里不是一個比較運算符,
script type="text/javascript"
$($(".navbar li").click(function(){
$(this).addClass("test");
}));
/script
上面這段放到你的代碼里試試
循環(huán)圖片和按鈕 都加上索引
然后給每個按鈕加上事件
也就是說當點擊第幾個按鈕就顯示第幾張圖片。
!DOCTYPE?HTML
html
head
meta?charset="UTF-8"?/
titlemain.html/title
style?type="text/css"
table?{
width:?100%;
border:?1px?solid?black;
border-collapse:?collapse;
}
td,th?{
border:?1px?solid?black;
}
/style
script?type="text/javascript"?src="jquery-1.8.0.min.js"/script
script?type="text/javascript"
$?(function?()
{
var?tbody?=?$?('tbody');
$?('#add').click?(function?()
{
$?('tbody?tr:not(:contains("作者"))').each?(function?(i,?dom)
{
tbody.append?($?(this).clone?());
});
});
});
/script
/head
body
table
tbody?id="picture"
tr
th作者?:/th
td
ul
liinput?style="width:?500px;"?type="text"?name="author[]"?class="input-text"?size="60"?maxlength="200"?value=""?/
/li
/ul/td
/tr
tr
th圖文標題?:/th
td
ul
liinput?style="width:?500px;"?type="text"?name="title[]"?class="input-text"?size="60"?maxlength="200"?value=""?/
/li
/ul/td
/tr
tr
th閱讀原文鏈接?:/th
td
ul
liinput?style="width:?500px;"?type="text"?name="content_source_url[]"?class="input-text"?size="60"?maxlength="200"?value=""?/
/li
/ul/td
/tr
tr
th圖文內(nèi)容?:/th
td
ul
litextarea?style="width:?500px;?b?height:?50px;"?name="content[]"?class="input-text"?rows="2"?cols="56"/textarea
/li
/ul/td
/tr
tr
th圖文圖片?:/th
td
ul
liinput?type='file'?name='pic[]'
/li
/ul/td
/tr
/tbody
/table
div?class="bk15"/div
div?class="btn"
input?type="hidden"?name="formhash"?value="404446c9a547d166"?/?input?type="button"?id="add"?name="action"?value="添加"
style="visibility:?visible;?margin-left:?350px;?background-color:?#004499;?border:?none;?width:?55px;?height:?28px;?color:?#fff;?margin-top:?30px;"?/
/div
/body
/html
工具:網(wǎng)頁調(diào)試工具如火狐firebug,還有谷歌自帶的前端調(diào)試叫什么忘記了,
打開網(wǎng)頁,F(xiàn)12 進入調(diào)試,查看元素 ,鼠標移上去看就知道了,比如你這張圖片在這個網(wǎng)頁是這樣的img class="ikqb_img" src="" esrc=""
css: #showGo{display:none;} js(引入jQuery): setTimeout(function(){ $("#showGo").show("slow"); },3000);
當前文章:jquery圖文,jquery語句
文章地址:http://chinadenli.net/article44/dsgoeee.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、網(wǎng)站營銷、企業(yè)建站、品牌網(wǎng)站制作、定制網(wǎng)站、App開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)