//錯誤:未捕獲的SyntaxError:意外的令牌:未捕獲的SyntaxError:意外的令牌:(在Javascript)
//說,誤差是在第一行上。我對這個真的很陌生,毫無頭緒。有任何想法嗎?
dropit:function(obj, e, dropmenuID){
if (this.dropmenuobj!=null) //hide previous menu
this.dropmenuobj.style.visibility="hidden" //hide menu
this.clearhidemenu()
if (this.ie||this.firefox){
obj.onmouseout=function(){cssdropdown.delayhidemenu()}
obj.onclick=function(){return !cssdropdown.disablemenuclick} //disable main menu item link onclick?
this.dropmenuobj=document.getElementById(dropmenuID)
this.dropmenuobj.onmouseover=function(){cssdropdown.clearhidemenu()}
this.dropmenuobj.onmouseout=function(e){cssdropdown.dynamichide(e)}
this.dropmenuobj.onclick=function(){cssdropdown.delayhidemenu()}
this.showhide(this.dropmenuobj.style, e)
this.dropmenuobj.x=this.getposOffset(obj, "left")
this.dropmenuobj.y=this.getposOffset(obj, "top")
this.dropmenuobj.style.left=this.dropmenuobj.x-this.clearbrowseredge(obj, "rightedge")+"px"
this.dropmenuobj.style.top=this.dropmenuobj.y-this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
}
}
嗯,這是一個對象的一部分? – epascarello
由於您是新手,因此可以使用Pro-Tip:通過塊縮進您的代碼。每次你放入一個'{'時,下一行應該縮進一級。每次輸入'}'時,都應該在下一行刪除一層縮進。通過縮進,我的意思是打'TAB'或打'空格'2或4次(您的偏好)。它使您的代碼更易於閱讀並且更易於調試。 –
你是在寫*這段代碼還是你想剪切粘貼? – Pointy