Changed javascript to display correct slider on mobile devices