https://github.com/postor/onshown
a jquery plugin that can trigger when an element is shown in view port
https://github.com/postor/onshown
Last synced: 2 months ago
JSON representation
a jquery plugin that can trigger when an element is shown in view port
- Host: GitHub
- URL: https://github.com/postor/onshown
- Owner: postor
- Created: 2014-09-03T07:12:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-03T07:45:09.000Z (over 10 years ago)
- Last Synced: 2025-01-25T18:09:57.199Z (4 months ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
onShown
=======a jquery plugin that can trigger when an element is shown in view port
usage
========### html
#a {
background: #eee;
padding-bottom: 1000px;
}
#b,#c {
background: red;
height: 200px;
}
### js
var show = $('div').onShown({
callback:function(el){
console.log(el);
}
});
params
========### partShown
when to trigger, when part of element enters(when set to true) or fully entered(set to false)### callback
when trigger it callback and pass element as paramater### bind
a function that bind to an event, default is binded to $(window).scroll