Skip to content

+ pv (percent of view) parameter#31

Open
hovsep wants to merge 1 commit into
customd:masterfrom
hovsep:master
Open

+ pv (percent of view) parameter#31
hovsep wants to merge 1 commit into
customd:masterfrom
hovsep:master

Conversation

@hovsep

@hovsep hovsep commented Jul 2, 2015

Copy link
Copy Markdown

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

samatcd commented Jul 2, 2015

Copy link
Copy Markdown
Member

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