基于jQuery的簡單九宮格實(shí)現(xiàn)代碼
更新時(shí)間:2012年08月09日 00:00:57 作者:
聽朋友說要作個(gè)九宮格,我也就隨便寫一個(gè),等待完善
復(fù)制代碼 代碼如下:
<input type="button" value="1"/>
<input type="button" value="2"/>
<input type="button" value="3"/><br>
<input type="button" value="4"/>
<input type="button" value="5"/>
<input type="button" value="6"/><br>
<input type="button" value="7"/>
<input type="button" value="8"/>
<input type="button" value="9"/><br>
<input type="text" value=""/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
var items="";
jQuery(function(){
$("input:button").each(function(index){
$(this).mouseover(function(){
if(items.indexOf($('input').eq(index).val())==-1){
items+=$('input').eq(index).val();
$('input:text').val(items)
}
})
})
})
</script>
您可能感興趣的文章:
- 用xhtml+css寫的相冊自適應(yīng) - 類似九宮格[兼容 ff ie6 ie7 opear ]
- 九宮格的含義 橫豎斜三個(gè)數(shù)相加都等于15
- android 九宮格滑動(dòng)解鎖開機(jī)實(shí)例源碼學(xué)習(xí)
- Android 九宮格的實(shí)現(xiàn)方法
- Java實(shí)現(xiàn)解出世界最難九宮格問題
- js實(shí)現(xiàn)九宮格圖片半透明漸顯特效的方法
- Android實(shí)現(xiàn)九宮格(GridView中各項(xiàng)平分空間)的方法
- Android開發(fā)之實(shí)現(xiàn)GridView支付寶九宮格
相關(guān)文章
基于jQuery實(shí)現(xiàn)定位導(dǎo)航位置效果
這篇文章主要為大家詳細(xì)介紹了基于jQuery實(shí)現(xiàn)定位導(dǎo)航位置效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-11-11jquery click([data],fn)使用方法實(shí)例介紹
大概意思就是觸發(fā)每一個(gè)匹配元素的click事件,本文通過一個(gè)實(shí)例為大家詳細(xì)介紹下jquery click([data],fn)的使用方法,感興趣的朋友可以參考下哈,希望對大家有所幫助2013-07-07使用jquery-easyui的布局layout寫后臺(tái)管理頁面的代碼詳解
這篇文章主要介紹了使用jquery-easyui的布局layout寫后臺(tái)管理頁面的代碼詳解,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-06-06jQuery實(shí)現(xiàn)購物車的總價(jià)計(jì)算和總價(jià)傳值功能
這篇文章主要介紹了jQuery實(shí)現(xiàn)購物車的總價(jià)計(jì)算和總價(jià)傳值功能 ,代碼簡單易懂,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2018-11-11jQuery 利用$.ajax 時(shí)獲取原生XMLHttpRequest 對象的方法
這篇文章主要介紹了jQuery 利用$.ajax 時(shí)獲取原生XMLHttpRequest 對象的方法,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2016-08-08jQuery中$.ajax()和$.getJson()同步處理詳解
這篇文章主要介紹了jQuery中$.ajax()和$.getJson()同步處理詳解的相關(guān)資料,非常的細(xì)致全面,有需要的小伙伴可以參考下。2015-08-08jqGrid增加時(shí)--判斷開始日期與結(jié)束日期(實(shí)例解析)
jqGrid增加時(shí)--判斷開始日期與結(jié)束日期(實(shí)例代碼)。需要的朋友可以過來參考下,希望對大家有所幫助2013-11-11