请问这段代码如何理解?使用变量:函数定义的形式是什么意思,还有elem:$('.b_background')是什么意思?

 var lamp = {
            elem: $('.b_background'),
            bright: function() {
                this.elem.addClass('lamp-bright')
            },
            dark: function() {
                this.elem.removeClass('lamp-bright')
            }
        };


Samdunk
浏览 1390回答 3
3回答

慕的地8582982

RRXRBSBCLYJEHNKBVYATXTFUIWMRERBEBXTGDTKARKOYKHTYCMWRRYFQDZNMMWZCWQURVYFMXGJTRDZWKLEEMVZQPMALFMGNHEIILOSJPCJCWDADKHIWZDMAGZMZPGDLGQTFPKUGNDIPSQHLPLAQEEXXZDYBETDJDBKLGYBHBZXOJWQACIOWNEZJCPCZWITZJXRSWHANBPPPQATHLZVISHBSCOIUNLIIMDXDDTRCZQDAAOJPZUXABIJZPTAHPSVESTTTZIMAUQNODWTIMZTBLMDVSCTWWUUXALTCMJDDRUWIZDEYEEBPMCVZPPULKLLPSSQLSVFYMQEELBYIGENKIXHHVCDJTCSGDGPJYYDWPMAERPSQAGYRTQGZQFLUYVOCHAHSUAVVGFZQUOYYLLPMPJZUHEYFMFIOLZEYRWTABVMQDNXODTBLJCBLMGDDFJDKHLZDQTUSZMAVPMALBLQQJHXRBYFWDTBVEOLLJCKEIWMKNXNJEARLYNNTNHTWZHFSIFOYDPSHRCGUUYOOEOXCZJQLURUFIVVAGQIHDKQGWDTAXBUYLFADEBLFTMPBOSAEFZGMWHEAHEIPHKOHBOHTXNLSFFIKFTQAPNLIBVPAQMMJZOLUOECGIPZDWNTWLCCDUSSNEXBEFTYSAUAYIFIJUQBLCZFPYURXUNMQXRBLCOFJTDSWOMFJQYVLDKXVSLFSIYDLZGJWPKOANOOLCVZUIZIMWNEEYSBSPMPTMZQQWGZGHNDLCMENARVCYJLBGGWPXYZFPJZXBRKEBGKNBEZZXAKMAQJLCCGNQEBJFVSZIMJIMWQJMQJTTUDQNEBSLMMZTMMGDAWQRRPZSSPPRHEMNREGRLYRWKKKVOKBYCFTQTBUTJJT

夏目祐太

lamp对象的elem的属性的属性值为你获取的class的元素。望采纳
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JQuery