I have this variable
var item_width = $('#slides li').outerWidth();
and want to modify it to include #slides2 li as well. Do i have to write two vars and use them in their respective functions or is there a way to include both IDs in a single line?
I am doing this because I have two divs (that toggle) containing two different slide carousels and am trying to share as much of the scripts as possible.
// EDITED to extrapolate //
i’m missing something simple here, i just know it. the first div works no problem, the second just won’t work. should i use classes instead? (that may be a dumb question, but i’m VERY new to JS)
there is quite a bit of code and i couldn’t get the jsfiddle working so i just posted a dev doc to our production site.
(url deleted)
// EDIT //
nevermind, the problem was with the css, not the script. adding clear: both to #slides ul, #slidesTwo ul put them all on a separate line. they were all floating left outside of the ul
1 Answer