Musti Rabin
Musti Rabin

Reputation: 183

Facebook Canvas App with a Fixed Position div

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.

Upvotes: 3

Views: 820

Answers (1)

Lukas Ignatavičius
Lukas Ignatavičius

Reputation: 3625

        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.

Upvotes: 1

Related Questions