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 7721989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:04:09+00:00 2026-06-01T04:04:09+00:00

ive created a lightbox where I have centered the div horizontally and vertically with

  • 0

ive created a lightbox where I have centered the div horizontally and vertically with a fixed position and jquery.

Everything works perfect except in ie8 it seems that it doesnt subtract the object width and height.
That way it is not in the very center of the screen instead its a little to the bottom and the right.

Any ideas how to make this work well?

function lightbox(){
    var w_width = $(window).width();
    var w_height = $(window).height();

    var obj_width = $('.image_big').width();
    var obj_height = $('.image_big').height();

    $('#image_big').css('top', (w_height / 2) - (obj_height / 2)).css('left', (w_width / 2) - (obj_width / 2))
}

lightbox();

$(window).resize(function(){
    lightbox();
});
  • 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-01T04:04:10+00:00Added an answer on June 1, 2026 at 4:04 am

    semicolon(;) mistake I think.

     $('#image_big').css('top', (w_height / 2) - (obj_height / 2)).css('left', (w_width / 2) - (obj_width / 2));
    

    Also post the style you are using, it should be position:fixed

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

Sidebar

Related Questions

I have problem with using class instance in Python. Ive created a new class
I have a website that consists of one parent page. Using the lightbox-style jQuery
I have a table of data which contains newsarticles. ive created standard CRUD views/forms
Ive created a 64x64 favicon for a site im making and its displaying fine.
http://jsbin.com/utisoz/edit#javascript,html Ive created a simple table without Tbody how ever it seems that it
I've got a custom control ive created that is instanced in my view, in
Using VS2010 and SQL express 2005, Ive created a database, created a simple table,
Ive created a portfolio website for myself, there is a gallery which users can
I am trying to generate random data for my sql server database. Ive created
I have created a function in one of my Joomla PHP files. Essentially, the

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.