CalEnder
CalEnder copied to clipboard
add window re-size and scroll events
Add window re-size and scroll events to adjust the offset of calender.
this is going to be a little intense without throttling. perhaps adding the following would help
function throttle(wait, fn, opt_scope) {
var timeout
return function () {
var context = opt_scope || this
, args = arguments
if (!timeout) {
timeout = setTimeout(function () {
fn.apply(context, args)
timeout = null
},
wait
)
}
}
}
$(window).on('scroll resize', throttle(100, function (e) {
// ...
}))