One problem here is that your function declaration makes it inaccessible from outside:
jQuery(function offset_value() { ... });
This declares an anonymous function which can only be referenced by offset_value
from the function's own body.
To fix this, you must declare the function outside:
function offset_value()
{
...
}
jQuery(offset_value); // run on document ready
You can also remove the $(document).read()
because that's already done when you use jQuery(fn)
.
Update
To reinitialise the plugin you need to reset the global pageScroller
:
pageScroller = {};
$('body').pageScroller({ ... });