-
-
Notifications
You must be signed in to change notification settings - Fork 3
module_isOnScreen
Wesley de Groot edited this page Oct 28, 2015
·
4 revisions
_ _____
| | / ____|
| | | (___
_ | | \___ \
______ _ | |__| | ____) |
|______| (_) \____/ |______/
Check if object is still on screen, we got 3 options!
<script type='text/javascript'>
_().require('_isonscreen', function () {
// Call function when changed
_('.wrapper').isOnScreen(
function () {
console.log('on Screen');
},
function () {
console.log('Terrible, i\'m Lost!')
})
})
</script>
Please Don't forget the .
on the beginning to say that you set a class
<script type='text/javascript'>
_().require('_isonscreen', function () {
// Change class when changed
_('.wrapper').isOnScreen(
'.classOnScreen',
'.classOffScreen'
);
})
</script>
<script type='text/javascript'>
_().require('_isonscreen', function () {
// Change style when changed
_('.wrapper').isOnScreen(
'background: red;',
'background: green;'
)
})
</script>
© Wesley de Groot • CC-BY 4.0 • WDGWV