Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
78
rated 0 times [  81] [ 3]  / answers: 1 / hits: 5119  / 10 Years ago, fri, march 28, 2014, 12:00:00

How can i detect if some element is visible? For better understading look at the image below.



Screen



I want to fire event when the image is half-visible. It would be great if it would work for all browsers and devices (tablets and smartphones).


More From » jquery

 Answers
0

Jquery.fracs plugin seems to do exactly what you need.



function callback(fracs: Fractions, previousFracs: Fractions) {
if(fracs > 0.5)
doSomething();
};

var fracs = $(img).fracs(callback);

[#46478] Thursday, March 27, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
wilson

Total Points: 27
Total Questions: 93
Total Answers: 93

Location: Tajikistan
Member since Sun, Aug 29, 2021
3 Years ago
wilson questions
Tue, Aug 9, 22, 00:00, 2 Years ago
Wed, May 11, 22, 00:00, 2 Years ago
Wed, May 20, 20, 00:00, 4 Years ago
Wed, May 13, 20, 00:00, 4 Years ago
;