added javascript code for slider transition functionality