Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- currMarg = (currMarg == 1800) ? (0) : (currMarg + 600);
- contStyle.marginLeft = "-%dpx".replace("%d", curMarg);
- // Upon reading what this code does, I notice some hard-coding that could be done away with
- const margMultiplier = -600;
- currMarg = ++currMarg % 4;
- contStyle.marginLeft = "%dpx".replace("%d", curMarg * margMultiplier);
- // Much better. Result is 0->1->2->3->0->... versus 0->600->1200->1800->0->...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement