.className = ' '; } bullets[pos].className = 'on'; } }); var bullets = document.getElementById('scroll_position').getElementsByTagName('li'); $(function(){ $('.scroll_position_bg').css({ width:$('#scroll_position').width() }); });