I’ve just wrote the code below to add a class to the outer div where it matches. Now I know there must be a more elegant way to achieve the below!
if ($(".cur").hasClass("one")) { $("#outer").addClass("one"); }
if ($(".cur").hasClass("two")) { $("#outer").addClass("two"); }
if ($(".cur").hasClass("three")) { $("#outer").addClass("three"); }
if ($(".cur").hasClass("four")) { $("#outer").addClass("four"); }
if ($(".cur").hasClass("five")) { $("#outer").addClass("five"); }
if ($(".cur").hasClass("six")) { $("#outer").addClass("six"); }
Any improvements will be gladly received 🙂
Live DEMO
Notes:
.curin the code, it’s done automatically..cur(exceptcuritself), so it’s up to you to decide if it’s good for you or not.