thanks to some help i got around i made this jquery function that gets the sum of widths of IMGs within a DIV.
now i have a new problem: multiple div.IDs with different widths, how can i make it most performant?
my code is this, for 1 div:
$(window).load(function(){
var widthSum = 0;
$('#oneid.scroll-content-item img').each(function(){
widthSum += $(this).width() + 20;
});
$( ".scroll-content" ).css('width', widthSum);
should i repeat this code several times with different IDs? if i make for example multiple selectors like this:
$('#oneid.scroll-content-item img, #twoid.scroll-content-item img').each(function(){
it will count them together, but i need separate.
any ideas?
thanks all!
+ 20).