How to use the value of an array as value of an attribute?
Hello wizkids/ wizman of this forum,
I was wondering if I could use the vallue of an array as value for an attribute.
- var docus = ["#docu1", "#docu2", "#docu3", "#docu4", "#docu5", "#docu6", "#docu7", "#docu8"];
- var spots = ["100%", "300%", "600%", "600%", "600%", "700%", "800%", "900%"];
- for (var i = 0; i < docus.length; i++){
- docus[i].css({
- left: spots[i]
- });
- }
I have multiple pages and although I innitially wanted to make a function to add or subtract 100% of the left values. People on this website need to have the possibility to jump to a certain page.
I would love it if someone knows the solution, cause that would make my code so much cleaner, instead of using 20 variables and manipulating those one by one.
anyone thx for your responce!