Is there a way to show a fixed position div in a Canvas app with a "setAutoGrow()" turned on ? I want to be able to show a Feedback widget that will always be visible to the user, even when scrolling up an down.
Asked
Active
Viewed 814 times
3
-
im having the same issue, did you find a fix? – t q Oct 17 '12 at 20:56
1 Answers
1
var fixed = function() {
FB.Canvas.getPageInfo(function(pageInfo) {
var offset = Math.max(parseInt(pageInfo.scrollTop) - parseInt(pageInfo.offsetTop), 0);
$("#menu").animate({
top: Math.max(offset, 0)
}, 100);
fixedTimer = setTimeout(fixed, 200);
});
};
use this function if you whant to keep element at top.

Lukas Ignatavičius
- 3,496
- 2
- 24
- 29
-
Hello! I tried your implementation but encountered the following in my developer console: "Uncaught SecurityError: Blocked a frame with origin "mydomain.com" from accessing a frame with origin "facebook.com". The frame being accessed set "document.domain" to "facebook.com", but the frame requesting access did not. Both must set "document.domain" to the same value to allow access." Did you encounter this too? – Brenda Nicole Tan Aug 26 '15 at 08:44
-
Hello @BrendaNicoleTan, I have not used this method for quite some time now. This issue is caused because you are trying to access webpage (facebook) from iframe, but if you will build your application correctly this issue should be solved. Try reading this [answer](http://stackoverflow.com/questions/14892556/facebook-unsafe-javascript-issue-document-domain-values-should-be-same) – Lukas Ignatavičius Aug 27 '15 at 15:54