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.
加载中,请稍侯......
精彩评论