first use jquery
$( "element:nth-child(7)" ).addClass("seventh_child");
$( "element:nth-child(4)" ).addClass("fourth_child");
with above you will able to find out every 7th and 4th element now with the help of media query you can add and remove css property according to device width.
i think it will help you...