简体   繁体   中英

how to make margin-left auto increment with bootstrap 3.0.0

i need add margin-left into .card class "style" element auto generate margin-left every time post page input.

my jquery version 1.12.4

my idea is

if .card css style margin-left 0 and with 479px set position 0
else set position margin-left 479px 
else set position mergin-left ...px

becuse im new learning javascript, so im trying help ask question with this code

enter link description here

i found solution.

$(function () {
$(".card").css("margin-left", function (i) {
  return i * 479;
});

});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM