开发者

mootools element.src

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜