473,473 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Popup positioning on MSIE

I´m trying to implement a:hover popup images like Eric Meyer did at
<http://meyerweb.com/eric/css/edge/popups/demo2.html>. My take is at
<http://www.cafecopan.com/dev/20050523/>. Mozilla 1.6 and Opera 7.53
display as intended: upon hovering over the text on the right, a
corresponding image pops up on the left, covering the default image. MSIE,
however, places the images on the right, over the text. Does anyone have
any idea what I am doing wrong?

TIA,
--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/
Jul 21 '05 #1
7 1741
Els
Warren Post wrote:
I´m trying to implement a:hover popup images like Eric Meyer did at
<http://meyerweb.com/eric/css/edge/popups/demo2.html>. My take is at
<http://www.cafecopan.com/dev/20050523/>. Mozilla 1.6 and Opera 7.53
display as intended: upon hovering over the text on the right, a
corresponding image pops up on the left, covering the default image. MSIE,
however, places the images on the right, over the text. Does anyone have
any idea what I am doing wrong?


Well, you set position:relative on the div.content, and then
position:absolute on the image inside that div. This will position the
image absolute, relative to its positioned parent.
The parent has a left padding of 350px, and IE handles paddings
differently. The position of the image is now 4em to the right of the
padding of 350px.

Why so complicated?
Just set the content at 350px from the left instead of giving it a
padding, and then position the image at -350px (or whatever works out
to be 350px - 4em; 300px to the left seems about right)

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Carly Simon - You're So Vain
Jul 21 '05 #2
Thanks, I´ll give that a try.
Why so complicated?


Good question. This is one of those projects that has sprawled as it has
grown, and my code isn´t exactly clean anymore. All observations welcome,
including ¨your code sucks¨.

--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/
Jul 21 '05 #3
Els
Warren Post wrote:
Thanks, I´ll give that a try.


Please quote the relevant part(s) of the post you're replying to, we
don't all memorize all the posts we read and write all day in numerous
groups :-)
Why so complicated?


Good question. This is one of those projects that has sprawled as it has
grown, and my code isn´t exactly clean anymore. All observations welcome,
including ¨your code sucks¨.


[<http://www.cafecopan.com/dev/20050523/>]

I'd just use a strict doctype, including the declaration url, and
decide between HTML and XHTML. If your doctype says HTML, don't use
/> at the end of the image tags.

And change Café Copán in the alt text also to Caf&eacute;
Cop&aacute;n, like you did everywhere else.

Other than that, your code seems fine to me :-)

If the CSS code isn't clean anymore like you said, I usually start
over. I'll have in my head (my own head, not the page's) the most
important rules, which I'll write again first, and then I build it up
fresh, so I don't get the blocks of CSS where I have forgotten why
exactly I gave something a certain height, width, margin or padding.
I do this using Firefox, and when all looks well, I check the other
browsers. Besides ending up with cleaner code, and having a second
chance to not forget to comment a couple of rules that are there for a
less obvious reason but still really are needed, I also learn from
discovering some things for the second time.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 21 '05 #4
On Fri, 03 Jun 2005 00:57:42 +0200, Els wrote:
Why so complicated?
I was trying to get everything (header, navbar, and content) to line up 4
ems along the left of the viewport. I prefer ems to pixels for this
because it makes the design more forgiving of differnt font and viewport
sizes, but I see your point and I like the simplicity of your solution.
Just set the content at 350px from the left instead of giving it a
padding, and then position the image at -350px (or whatever works out to
be 350px - 4em; 300px to the left seems about right)


Done; see result at <http://www.cafecopan.com/dev/20050604/>. I´ve left
the former example in place for comparison. Your suggestion solves the
problem but introduces a new one: div.content has shifted to the right but
retains the width it would have had had it not been shifted. The result is
that the right side of div.content extends beyond the right side the body.
For illustrative purposes I´ve added background: blue to div.content so
you can see what I mean. If your viewport is wide and your font size is
small, the problem may not be immediately obvious.

In Mozilla 1.6 and Opera 7.53, a horizontal scrollbar appears so you can
scroll beyond the right edge of the body and see the rest of div.content.
Yuck! MSIE 6.0 truncates the part of div.content that goes beyond the
body, which doesn´t look as bad but has even worse consequences for
useability.

So how can I set div.content to never extend beyond the right of the body?

And thank you. I appreciate your time and thoughts.

--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/
Jul 21 '05 #5
Warren Post wrote:

<http://www.cafecopan.com/dev/20050604/>

div.content has shifted to the right but
retains the width it would have had had it not been shifted.


That's because you relatively positioned it with a left offset of 300px.
Relative positioning doesn't work as you probably imagine it should.
It's often misunderstood.
<URL:http://www.w3.org/TR/CSS21/visuren.html#propdef-position>

Don't set left:300px, set margin-left:300px.
Change any right to margin-right while you're at it. Adjust to taste.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 21 '05 #6
Els
Warren Post wrote:
Just set the content at 350px from the left instead of giving it a
padding, and then position the image at -350px (or whatever works out to
be 350px - 4em; 300px to the left seems about right)
Done; see result at <http://www.cafecopan.com/dev/20050604/>. I´ve left
the former example in place for comparison. Your suggestion solves the
problem but introduces a new one: div.content has shifted to the right but
retains the width it would have had had it not been shifted.


That's what Kchayka pointed out in the other post; position:relative
may do something different than you expect. It shifts the entire
element to the right in this case. To compensate on the right side,
you need a right margin (/not/ a negative one!) of the same width as
you set the value of the left property.

So, if you just change right:-300px; (you can't set both left and
right values on a relative positioned element) to margin-right:300px;,
you're fine :-)
(I'd make it margin-right:350px; to look better)
And thank you. I appreciate your time and thoughts.


You're welcome.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 21 '05 #7
On Sat, 04 Jun 2005 20:08:16 +0200, Els wrote:
So, if you just change right:-300px; (you can't set both left and right
values on a relative positioned element) to margin-right:300px;, you're
fine :-)


Thank you, that was exactly it. I was confusing right: with margin-right:.

--
Warren Post
Santa Rosa de Copán, Honduras
http://srcopan.vze.com/
Jul 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
by: Shaun McKinnon | last post by:
HI...Here's my problem...I have a popup window that loads when i want it to, but it's not sized properly. I've set the size, but it doesn't seem to work. I've been on 8 different websites to find...
10
by: Oliver | last post by:
Hello, i'm having trouble with a css type popup. It's not doing what i want in Mozilla 1.6 and in IE6.0 it's not working at all. The html code looks like this: <div class="themenkueche"...
17
by: pasdecrap | last post by:
The following code will produce similar results in IE6 and firefox 1.0.4 however the left margin in FF is 4 pixels and in IE it is 5. Can anyone see why this is happening? I can't seem to figure...
9
by: Jimmy Junatas | last post by:
When we open a window (using client-side jscript ie. window.open("/Site/Popup.aspx?...",...)) from Page1.aspx, the called page Popup.aspx does not have access to the Session variables present in...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.