function $(id) {? ? ? ? return typeof id==='string'?getElementById(id):id;}$(window).load(function(){? ? ? ? var titles=document.getElementById('month_tit').getElementsByTagName('li');? ? ? ? var divs=$('month_con').getElementsByTagName('div');? ? ? ? if(titles.length!=divs.length)? ? ? ? ? ? ? ? return;? ? ? ? for(var i=0;i<titles.length;i++){? ? ? ? ? ? ? ? titles[i].id=i;? ? ? ? ? ? ? ? titles[i].onmouseover=function(){? ? ? ? ? ? ? ? ? ? ? ? for(var j=0;j<titles.length;j++){? ? ? ? ? ? ? ? ? ? ? ? ? ?titles[j].className='';? ? ? ? ? ? ? ? ? ? ? ? ? ?divs[j].style.display='none';? ? ? ? ? ? ? ? ? ? ? ? }? ? ? ? ? ? ? ? ? ? ? ? this.className='selected';? ? ? ? ? ? ? ? ? ? ? ? divs[this.id].style.display='block';? ? ? ? ? ? ? ? }? ? ? ? }}
為什么寫的沒有用?alert不出,id加不上!還顯示報錯Uncaught SyntaxError: missing ) after argument list
Hi_給我一個大甜筒
2016-10-08 11:03:55