开发者

mootools element.src

开发者 https://www.devze.com 2023-03-21 21:19 出处:网络
I am trying to decipher the following code function add_img(el) { el.addEvents({ \'mouseenter\':function() {

I am trying to decipher the following code

function add_img(el) {
        el.addEvents({
            'mouseenter':  function() {
           开发者_Python百科     var source = el.src;
                if (!(source.match("_active")))
                {
                    var newSource = source.replace(/_off/, "_on");
                    el.src = newSource;
                }
            }...

I was assuming el.src would change the img src of the element but instead it is accessing and changing the class, I cannot find src in documentation of mootools anywhere.. why is class getting changes instead of src?


src is an attribute on an HTML img element. Its the path to the image.

0

精彩评论

暂无评论...
验证码 换一张
取 消