Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7862845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:17:54+00:00 2026-06-02T23:17:54+00:00

Is there a way to set or reset color box options later, after events,

  • 0

Is there a way to set or reset color box options later, after events, like scrolling, have happened?

here is how you normally set colorbox options:

        jQuery("a[rel='pop']").colorbox({ transition:"none", top:20px;});

what I need is for the FB.canvas.getPageInfo() method to reset the ‘top’ option. So, the user has scrolled down say 300px. getPageInfo can tell you that. But, I cant figure out how to get getPageinfo() to talk to colorbox and change the setting, before opening the popup.

FB.Canvas.getPageInfo(callbak);
function callbak(info){
       i want to set the 'top' here, with info.scrollTop
        so that when colorbox pops, its positioned correctly.
}//callback

maybe what needs to happen is instead of doing the colorbox settings at (document).ready, I need to hook my rel=”pop” elements to a function that
tests for FB (because I’ll be using this page outside of fb, too.)
and then sets up colorbox,
then fires colorbox.

/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
I cant figure out how to code in comments, so here is almost working code:This below works, but only on the second click, and even then, it’s using the scrollTop from the previous click. The alert() before my colorbox setting has the correct info on the first click. Apparently, it’s setting the top ‘correctly’ for the next click, but i need the top to be reset for *this click.

 jQuery("a[rel='pop']").colorbox({ transition:"none", top:"5px", maxWidth:"85%", maxHeight:"85%",
      onOpen:function(){dothething(); }});  

function dothething(){
        FB.Canvas.getPageInfo(callbak);
        function callbak(info){
            var ist = info.scrollTop;
            // alert('callbak'+ist);
            jQuery("a[rel='pop']").colorbox({  top:ist+"px"});
        }//callback
    }//dothething
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T23:17:55+00:00Added an answer on June 2, 2026 at 11:17 pm

    Try:

    jQuery("a[rel='pop']").click(function(e) {
      e.preventDefault();
      link = jQuery(this).attr('href');
      FB.Canvas.getPageInfo(function(info) {
        ist = info.scrollTop;
        jQuery.colorbox({href:link, transition:"none", top:ist+"px;", maxWidth:"85%",maxHeight:"85%"});
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way I can set a div background color in hiccup? Here
Is there a way to re set a sender tag like NSMutableArray does when
Is there a way in vim to restore the terminal's original foreground color after
Is there a working way to remove all replication options set in a Lotus
I have this problem: Thread1 may set an auto-reset event, and there are many
Is there way to set @include mixin(); to variable? I tried this @mixin bg-gradient($fallback,
Is there any way to set up a PendingIntent with the download manager? Or
Is there any way to set order by clause in HQL by run time.
Is there any way to set DPI (dots per inch) in case of PDFsharp?
Is there a way to set a constant width for geom_bar() in the event

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.