第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

新手 關(guān)于JS面向?qū)ο缶帉懙男Ч恼{(diào)用方式的問題?

新手 關(guān)于JS面向?qū)ο缶帉懙男Ч恼{(diào)用方式的問題?

躍然一笑 2018-10-19 10:09:59
第一次編寫了面向?qū)ο蟮男Ч?,?yè)面有四個(gè)選項(xiàng)卡,在onload里這樣調(diào)用發(fā)現(xiàn)只有最后一個(gè)好使……求幫助 我需要怎樣調(diào)用這個(gè)函數(shù)???ps: tools.getByClass tools.$ 都寫了。window.onload = function() {    var tab1 = new Tab('shop','nav','shop');    var tab2 = new Tab('map','nav','map');    var tab3 = new Tab('konw','gradient','con');    var tab4 = new Tab('listTab','gradient','sideCon');}function Tab(id,className,divid) {    this.aBtn = tools.getByClass(id,className)[0].getElementsByTagName('li');    this.aDiv = tools.$(divid).getElementsByTagName('div');    _this = this;    for (var i=0; i<this.aBtn.length; i++) {        this.aBtn[i].index = i;        this.aBtn[i].onclick = function() {            _this.tab(this);        }    }}Tab.prototype.tab =  function(oBtn) {    for(var i=0;i<this.aBtn.length;i++) {        this.aBtn[i].className = 'gradient';        this.aDiv[i].style.display ='none';    }    oBtn.className = 'active';    this.aDiv[oBtn.index].style.display = 'block';}
查看完整描述

1 回答

?
呼啦一陣風(fēng)

TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超6個(gè)贊

_this=this換成var _this=this試試


查看完整回答
反對(duì) 回復(fù) 2018-11-07
  • 1 回答
  • 0 關(guān)注
  • 494 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)