Anchored items opened in Colorbox , makes the colorbox align on top off the page instead of centered in IE.

Hello Experts.

I have links to go to a anchors that are opened up in Colorbox however just like an anchor link opens with it at the top of the page, Colorbox loses center and also aligns to the top of the page in IE. Works find in other browsers.

Thank you in advance Experts.
colonelblueAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

uzzidesignCommented:
Do you have  a link or can you paste code? Which version of IE?

If I had to guess in the dark, I'd say it's due to IE's improper handling of the position property. IE may be defaulting to positioning the colorbox container relative to the <body>. Does specifying a position:relative on Colorbox's parent element help?
uzzidesignCommented:
Do you have a doctype specified?
colonelblueAuthor Commented:
Hello uzzi

Yes I have a doc type:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Version I.E.8

Where would I use position:relative?
I call it via a class: class="w2"
$(".w2").colorbox({iframe:true, innerWidth:575, innerHeight:400});


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link type="text/css" media="screen" rel="stylesheet" href="/colorbox.css" />


<script src="jquery.colorbox.js"></script>
<script>
			$(document).ready(function(){
$(".w2").colorbox({iframe:true, innerWidth:575, innerHeight:400});
$(".example8").colorbox({iframe:true, innerWidth:625, innerHeight:575});
//Example of preserving a JavaScript event for inline calls.
$("#click").click(function(){ 
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
					return false;
				});
			});
		</script>

Open in new window



I had some examples still in the code. :)

So odd because it works just fine in any other browser.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

uzzidesignCommented:
Still not exactly enough code for me to go off of, but I can reproduce your bug when I use colorbox in Quirks Mode (invalid doctype). Try swapping your doctype with something else, like HTML4, XHTML Strict, or HTML5 (html).
colonelblueAuthor Commented:
What can I provide you to assist?
My page is only in an intranet so I can not provide a link.

Thanks again.
uzzidesignCommented:
Did you try the doctype?

> What can I provide you to assist?
Your HTML (body) and inline CSS so I can preview locally.
colonelblueAuthor Commented:
Hello. Yes I did change the doctype.

The html an css for the main page with the link to the colorbox pop up?
Or the page with the anchored content for the pop up?
uzzidesignCommented:
Whichever one has the bug on it.
colonelblueAuthor Commented:
Hello uzzi. Sorry for the late reply. Meetings like nuts today.
It seems other people have had this problem too but I saw no solution posted.

<%@LANGUAGE="VBSCRIPT"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body {
	background-color: #CCC;
}

</style>

<link type="text/css" media="screen" rel="stylesheet" href="/colorbox.css" />
</head>


<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">


<table width="960" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
	<tr>
  <td rowspan="2"></td>
	</tr>
	<tr>
		<td height="25" colspan="2" align="right" bgcolor="#6666FF"><font size="2">
       
        </td>
  </tr>
	<tr>
		<td colspan="2" rowspan="2" valign="top" bgcolor="#9999FF">	  <div id="event_Pics">
		  <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Duis ligula lorem, consequat eget, tristique nec, auctor quis, purus. Vivamus ut sem. Fusce aliquam nunc vitae purus. Aenean viverra malesuada libero. Fusce ac quam. Donec neque. Nunc venenatis enim nec quam. Cras faucibus, justo vel accumsan aliquam, tellus dui fringilla quam, in condimentum augue lorem non tellus. Pellentesque id arcu non sem placerat iaculis. Curabitur posuere, pede vitae lacinia accumsan, enim nibh elementum orci, ut volutpat eros sapien nec sapien. Suspendisse neque arcu, ultrices commodo, pellentesque sit amet, ultricies ut, ipsum. Mauris et eros eget erat dapibus mollis. Mauris laoreet posuere odio. Nam ipsum ligula, ullamcorper eu, fringilla at, lacinia ut, augue. Nullam nunc.</p>
		 </td>
		<td valign="top" bgcolor="#9999FF">&nbsp;</td>
  </tr>
	<tr>
		<td align="center" valign="top" bgcolor="#9999FF"></td>
  </tr>
	<tr>
	  <td colspan="4" valign="top" bgcolor="#9999FF">&nbsp;</td>
	  <td>&nbsp;</td>
  </tr>
	<tr>
	  <td height="450" colspan="4" valign="top" bgcolor="#9999FF"><div id="Container2"></td>
	  
  </tr>
	<tr>
	  <td height="511" colspan="3" valign="top" bgcolor="#9999FF"><div id="eventLayer">
	    <div id="eventInfo1">
	      <p><a name="getting" id="getting"></a>Getting Here</p>
	      <table width="90%" border="0" class="attendee_links2">
	        <tr>
	          <td><a href="#" ">Calendar</a></td>
            </tr>
	        <tr>
	          <td><a href="#" > Directions</a></td>
            </tr>
	        <tr>
	          <td class="links2"><a href="#">Self &amp; Valet Parking</a></td>
            </tr>
          </table>
	    </div>
	  </div>
</td>
  </tr>

	<tr>
	  <td height="69" colspan="3" align="right" valign="top" bgcolor="#1371b0"></td>
  </tr>
	<tr>
		<td height="2">
	  </td>
		<td>
			<img src="images/spacer.gif" width="713" height="1" alt=""></td>
		<td>
			<img src="images/spacer.gif" width="246" height="1" alt=""></td>
	</tr>
</table>

</script>

</body>
</html>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
colonelblueAuthor Commented:
It seems the main issue lies on whether I have a table in the div.
I cannot find a true solution so closing this thread.
colonelblueAuthor Commented:
I did not get a solution.
One of those questions the other party stops replying.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.