variable for classname?
Closed this issue · 1 comments
deeve007 commented
In responsive-enhance.js, why not add a variable at the top of the document for editing the classname? Would be far easier to change for different sites ...etc.
joshje commented
The function responsiveEnhance takes an element (or array of elements) as it's first parameter and the width at which to replace the image as the second, like so:
responsiveEnhance(el, 400);
responsiveEnhance(array(el1, el2), 400);
So you could do the following to find all elements with the class ".classname":
var els = document.querySelectorAll('.classname');
responsiveEnhance(els, 400);
Or with jQuery:
var els = $('.classname');
responsiveEnhance(els, 400);
Feel free to fork this if you would like to implement a variable for editing the classname.