473,803 Members | 2,949 Online
Bytes | Software Development & Data Engineering Community
+ 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.c om/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 1762
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.c om/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:relati ve on the div.content, and then
position:absolu te 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.c om/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.c om/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.c om/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#pr opdef-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.c om/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:relati ve
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
5093
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 out what i'm doing wrong, and so far it seems i'm doing it the right way. Here's my code...any suggestions would be appreciated. <script language="javascript"> <!-- window.open("256fx/index.htm", "", "height=400, width=600"); //-->
10
2755
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" id="tk"> <h1>Themenk&uuml;chen</h1> <p>
17
14374
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 it out! TIA Jeff <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
9
4729
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 Page1.aspx. The IIS Log shows (listed below) shows that the ASP.NET_SessionId cookie is not present in Popup.aspx. The thing is that this mechanism works for 99% of our users. There is this one user that is consistently having this problem. ...
0
9566
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10317
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9127
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7607
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2974
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.