Comments (6)
Can you try withinviewport(document.getElementById('hello'))
?
If that doesn't work, can you post the code somewhere (preferably a reduced test on Codepen, JSBin, etc) so I can try and debug it?
from within-viewport.
I used this plugin and I also face same problem.
console.log(withinviewport(document.getElementsByClassName("quest-grid-image")[i])) always returns false even if the element is visible.
The element id is correct. I double checked it.
from within-viewport.
I can't reproduce the bug in my own demos so I wonder if some other CSS in your page is affecting it. Can you link to the page or put a quick demo in Codepen/JSBin? Are there any iframes involved?
from within-viewport.
I use it for this website: http://www.seenit.in. I included the ('js/jquery.withinviewport.js', 'js/withinviewport.js') files and used it as shown below:
$(window).bind("scroll", function() {
var i;
for(i=0;i<12;i++){
console.log(withinviewport(document.getElementsByClassName("quest-grid-image")[i]));
}
});
It always prints false on the console log, even if the element is fully visible on the screen.
from within-viewport.
This is now fixed with v1.0.0. Thanks for including the example code, @deliver2manish. I believe the issue was that the <div>
you were targeting was inside an <a>
(i.e. an inline element, rather than a block) and that tripped up the part of my code that calculates the target element's position. I'm using a faster and more robust method now.
from within-viewport.
Thanks. It fixes the bug for me.
On Mon, Aug 3, 2015 at 4:19 AM, Craig Patik [email protected]
wrote:
This is now fixed with v1.0.0
https://github.com/patik/within-viewport/releases/tag/1.0.0. Thanks for
including the example code. I believe the issue was that theyou
were targeting was inside an (i.e. an inline element, rather than a
block) and that tripped up the part of my code that calculates the target
element's position. I'm using a faster and more robust method now.—
Reply to this email directly or view it on GitHub
#16 (comment)
.
"Stay Hungry, Stay Foolish"
from within-viewport.
Related Issues (16)
- Ability to test if *any* part of element is visible HOT 3
- constant measurement HOT 1
- Doesn't seem to work inside scrollable element HOT 2
- publish to NPM HOT 4
- ESM support HOT 1
- jQuery plugin doesn't work HOT 2
- Content visibility in % HOT 1
- Define Viewport as Div? HOT 2
- ReferenceError: window is not defined in withinviewreport.js which is under node_modules HOT 3
- Update version HOT 3
- Update NPM version HOT 1
- Can't set the settings for the threshold HOT 3
- A bit scroll HOT 3
- [enhancement] Add missing bower.json.
- Use w/o jQuery HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from within-viewport.