Created
May 7, 2012 15:48
-
-
Save hpbuniat/2628544 to your computer and use it in GitHub Desktop.
Test for tracking clicks within an iframe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta content="Hans-Peter Buniat" name="author"> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf8"> | |
<title>test iframe clicks</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var f = { | |
b: false, | |
init: function(i) { | |
var t = this; | |
i.mouseover(function() { | |
console.log('over'); | |
t.b = true; | |
}).mouseout(function() { | |
console.log('out'); | |
t.b = false; | |
top.focus(); | |
}); | |
$(top).blur(function(e) { | |
if (t.b) { | |
console.log('click'); | |
} | |
}); | |
} | |
}; | |
f.init($('iframe')); | |
}); | |
</script> | |
</head> | |
<body> | |
<iframe src="http://www.fluege.de" width="50%" height="50%"></iframe> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment