jquery - Loop for custom attr -


I am looking for that loop which is

  1, 0.8, 0.6, 0.4, 0.2, 0.2, 0.4, 0.6, 0.8, 1   

and add to custom etter "data-depth" li element i and I

 for  (var i = 0; i & lt; 5; I ++) {$ tiles.eq (i) .attr ('data-depth', - (i * 0.2-1)); }   

Then the first part "1, 0.8, 0.6, 0.4, 0.2"

Can anyone help me?

Edit

Powerful community can increase this question, I have not written my efforts to solve my question (which I am sorry), some people helped me and I am very good for them.

A repetition Version ...

var number = 0; Var i = 1.2; Var al = jQuery ("UL"); Var phase = -0.2; While (count> 50) {if (i === 0.2) {If (step = 1) {if (Phase> 0) {i = 1.2; Phase = -0.2}} i = Math Plain ((i + step) * 100) / 100; Ul.append ("

  • " + I + "& lt; / li & gt;"); Count ++; }

  • Comments

    Popular posts from this blog

    java - ImportError: No module named py4j.java_gateway -

    python - Receiving "KeyError" after decoding json result from url -

    .net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -