fixed slide function on resize