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
758 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses how to implement server side field validation and display customized error messages to the client.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…

734 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