Scrolling when resizing window

Scrolling when resizing window

Hey everyone,

I've implemented a scrolling function:
var watTopPosition = jQuery(".artwat").offset().top + headerHeight  ;
$("html, body").animate({ scrollTop: watTopPosition }, 'slow');

My code get's called using:  $(document).ready(function () {

This works fine but when you resize the window the values aren't good anymore. And it scrolls to wrong positions.

Does anyone now how to fix this? How can you "reset" the values when you resize?

Tx,

Borrie