Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

DIVÖйö¶¯ÌõÉèÖõ½Ëæ»úλÖÃ(CSS+Javascript)

¸Õ²ÅÒ»¸öÅóÓѸæËßÎÒËûµÄblogÓÑÇéÁ´½ÓÌ«¶àÁË£¬ËùÒÔ°ÑËùÓÐÁ´½Ó·Åµ½Ò»¸öDIVÖУ¬¼ÓÁ˸ö¹ö¶¯Ìõ£¬¿ÉÊÇËûÓÖ²»Ïëÿ´Î±ðÈËÀ´¿´£¬¿´µ½µÄ¶¼ÊÇÇ°Ã漸¸öÁ´½Ó£¬ÓÚÊÇÎÊÎÒÓÐûÓÐʲô°ì·¨£¬ÏëÁËÒ»¸ö£¬ºÇºÇ£¬ÕýºÃÓиö°ì·¨
styleºóÃæÓÃÓÚÏÞ¶¨DIVÑùʽ²¢¼Ó¹ö¶¯Ìõ£¬Õâ¸ö²»¶à˵
¹Ø¼üµÄµØ·½ÆäʵºÜ¼òµ¥£¬×îºóÁ½ÐÐJavascript¾ÍÊÇÁË£¬Æð×÷ÓõÄÖ»ÓÐ×îºóÒ»ÐУº
obj.scrollTop=obj.scrollHeight*(Math.random());
obj.scrollTop£º¹ö¶¯Ìõ¾àÀ붥²¿µÄλÖÃ
obj.scrollHeight£ºÁ÷¶¯ÇøÓòµÄ¸ß¶È
Math.random()£º»ñµÃÒ»¸öËæ»úÊý
ºÜ¼òµ¥£¬ÓÐÈË¿ÉÄÜÐèÒª£¬ÓþÍÄÃÈ¥£¬¹þ¹þ
PS£ºIE6 / IE7 / FF2 ²âÊÔͨ¹ý
IE7ÔÚ±¾µØ²âÊÔʱֻÊÇÿ´Î´ò¿ªÊ±¹ö¶¯ÌõλÖòŲ»Í¬£¬Ë¢ÐÂȴûÓб仯£¬µ«·Åµ½ÍøÕ¾ÉÏÖ®ºó¾ÍÕý³£ÁË
´úÂëÈçÏ£º
<div id="cc" style="height:250px;width:200px;overflow-y:scroll;overflow-x:hidden;">
<li>01</li><li>02</li><li>03</li><li>04</li><li>05</li><li>06</li><li>07</li><li>08</li>
<li>09</li><li>10</li><li>11</li><li>12</li><li>13</li><li>14</li><li>15</li><li>16</li>
<li>17</li><li>18</li><li>19</li><li>20</li><li>21</li><li>22</li><li>23</li><li>24</li>
<li>25</li><li>26</li><li>27</li><li>28</li><li>29</li><li>30</li><li>31</li><li>32</li>
<li>33</li><li>34</li><li>35</li><li>36</li><li>37</li><li>38</li><li>39</li><li>40</li>
<li>41</li><li>42</li><li>43</li><li>44</li><li>45</li><li>46</li><li>47</li><li>48</li>
</div>
<script>
var obj = document.getElementById("cc");
obj.scrollTop=obj.scrollHeight*(Math.random());
</script>


Ïà¹ØÎĵµ£º

JavaScript »ñÈ¡¶ÔÏóµÄ¸ß¶ÈºÍ¿í¶ÈÏêϸ˵Ã÷

scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......

³£ÓÃJavaScriptÅжÏ×Ö·û´®µÄһЩ´úÂë

 //ÅжÏÊäÈëÄÚÈÝÊÇ·ñΪ¿Õ
function IsNull(){
var str = document.getElementById('str').value.trim();
if(str.length==0){
alert('¶Ô²»Æð£¬Îı¾¿ò²»ÄÜΪ¿Õ»òÕßΪ¿Õ¸ñ!');//Ç뽫“Îı¾¿ò”¸Ä³ÉÄãÐèÒªÑéÖ¤µÄÊôÐÔÃû³Æ!
}
}

//ÅжÏÈÕÆÚÀàÐÍÊÇ·ñÎ ......

javascript:window.showModalDialog»º´æÎÊÌâ

 À´Ô´£ºhttp://blog.csdn.net/Mr_Von/archive/2009/04/29/4136273.aspx
window.showModalDialog»áÓлº´æ£¬µ¼Öµڶþ´Î²»½øÈëpageload£¬½â¾ö·½·¨£º¸úÒ»¸öËæ»úµÄ²ÎÊý£º
          var time =new Date();
          var iW ......

JAVASCRIPTÉí·ÝÑéÖ¤ £¨Ñ§Ï°¾­Ñ飩

javascript ´úÂëΪ£º
function getName(code){
var name=xzqh[code];
if(name==null){
return name;
}
//Èç¹û²»ÊÇ00½áβµÄ£¬Ôò²¹ÉÏÊÐÃû³Æ£¬659000ÀýÍâ 429000,469000
if(code%100 != 0 && (code-code%100)!=659000 && (code-code%100)!=429000 && (code-code%100)!=469000){
var cityName= ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ