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

  • Home
  • SEARCH
  • 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 6703005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:07:13+00:00 2026-05-26T07:07:13+00:00

I have a lightbox that comes up with instructions in it. It has remote

  • 0

I have a lightbox that comes up with instructions in it. It has remote links that then flip through several pages of content, replacing elements in the lightbox remotely.

The problem I have is that when new content is rendered in the lightbox, it doesn’t reposition the lightbox. It DOES however, reposition the box if you attempt to resize the window.

Does anyone know how I can add a line of code to reposition the lightbox following a remote page change?

Background information: I render content in the lightbox as such:

 <%= render 'partial1' %>

The link that remotely changes this partial uses a “next_page” action in a controller. This action responds remotely, and thus a next_page.js.erb file is available (wherein maybe a solution could be added).

If there is other relevant background information I can provide, please let me know.

  • 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-05-26T07:07:14+00:00Added an answer on May 26, 2026 at 7:07 am

    If the lightbox re-sizes itself when the browser is re-sized, try triggering a resize event on the window object (since the lightbox probably has an event listener for the resize event):

    $(window).trigger('resize);
    

    Add the above code to the end of the JavaScript that updates the contents of your lightbox.

    There are also a couple options in the Fancybox API that may help:

    1. $.fancybox.resize – You can cal this method and the lightbox will re-size itself based on the height of its current content.
    2. autoDimensions – this is an option you can set to true when initializing the lightbox and Fancybox will automatically re-size itself to the dimensions of new content. As the documentation states:

    “Make sure it has dimensions otherwise this will give unexpected
    results”

    Here’s where I found the API options: http://fancybox.net/api

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a lightbox that has one image, then some more images in the
I have a lightbox/modal that displays a form, but in select tag has a
I have a page where i have several links that when clicked, load a
I have a form on a lightbox, that form is server side validated with
I have a Lightbox clone (colorbox), which works fine and has no real issues.
I'm looking for a mobile lightbox that I can use my existing image links
Has anyone ever found any lightbox type javascript / css code that can display
On a couple pages of mine I have a Fancybox lightbox and I have
I've got the following code that shows a lightbox 'please wait' box, then does
I have a page that loads content via ajax. When I click on a

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.