Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+ pv (percent of view) parameter #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

+ pv (percent of view) parameter #31

wants to merge 1 commit into from

Conversation

hovsep
Copy link

@hovsep hovsep commented Jul 2, 2015

Percent of view.

pv parameter let you to define what part(in percent) of element is visible. As example, I need to play video, when it's 50 % is visible. I use jQuery('#video').pvisible(false,true,'both',50)

@samatcd
Copy link
Member

samatcd commented Jul 2, 2015

Nice! Although, I'd prefer to use the first parameter for this, given it's the same concept. E.g.,

$('#selector').visible(true) // current behaviour, true if the element is partially visible (min 1px onscreen)

$('#selector').visible(50) // your behaviour, true if at least 50% of the element is visible.

We can do this by using === for strict type checking on the first param. If it's numeric, we can treat it as a percentage, and if it's bool, we can use the traditional check.

If you make that small change I'll merge right away. Also would be helpful if you could commit the minified version too :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants