/ / Konwertuj skrypt z jQuery na prototyp lub wanilię - javascript, jquery, prototypejs

Konwertuj skrypt z jQuery na prototyp lub wanilię - javascript, jquery, prototypejs

Pracuję z interfejsem API i ich przykładami sązależne od jQuery do manipulowania selektorami css. Czy ktoś może mi pokazać, w jaki sposób mogę to osiągnąć, korzystając z biblioteki Prototype lub z villi javaScript?

  scrollEnd = function (element, dir, enable, init) {
var el = jQuery(element);
if (el.size()) {
if (enable) {
if (el.css("backgroundImage") == "none")
el.css("backgroundImage", element.button);
}
else {
element.button = el.css("backgroundImage");
el.css("backgroundImage", "none");
}
}
};

Odpowiedzi:

0 dla odpowiedzi № 1

Wanilia

scrollEnd = function (element, dir, enable, init) {
if (enable) {
if (!element.style.backgroundImage) {
element.style.backgroundImage = element.button;
} else {
element.button = element.style.backgroundImage;
delete element.style.backgroundImage;
}
}
};

Nie znam DOMElement, który ma atrybut size I button chociaż ... co napisałem? : P