Solved

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

Posted on 2012-04-09
11
754 Views
Last Modified: 2012-06-21
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.
0
Comment
Question by:colonelblue
  • 6
  • 5
11 Comments
 
LVL 6

Expert Comment

by:uzzidesign
ID: 37824219
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?
0
 
LVL 6

Expert Comment

by:uzzidesign
ID: 37824239
Do you have a doctype specified?
0
 

Assisted Solution

by:colonelblue
colonelblue earned 0 total points
ID: 37824295
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.
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
LVL 6

Assisted Solution

by:uzzidesign
uzzidesign earned 500 total points
ID: 37824351
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).
0
 

Author Comment

by:colonelblue
ID: 37824729
What can I provide you to assist?
My page is only in an intranet so I can not provide a link.

Thanks again.
0
 
LVL 6

Expert Comment

by:uzzidesign
ID: 37825047
Did you try the doctype?

> What can I provide you to assist?
Your HTML (body) and inline CSS so I can preview locally.
0
 

Author Comment

by:colonelblue
ID: 37828387
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?
0
 
LVL 6

Expert Comment

by:uzzidesign
ID: 37828520
Whichever one has the bug on it.
0
 

Accepted Solution

by:
colonelblue earned 0 total points
ID: 37830398
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

0
 

Author Comment

by:colonelblue
ID: 37999310
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.
0
 

Author Closing Comment

by:colonelblue
ID: 38016193
I did not get a solution.
One of those questions the other party stops replying.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question