Email conversation
From | Mike C |
To | Me |
Subject | Position: fixed; related issue |
Date | 14 June 2007 02:17 |
I'm running a live chat/support script called [brand] on a [brand]
site. It has a proactive chat invite feature which enables me to send a
floating image invite on command to my site visitor. Well, it was not
working in firefox or IE until I changed the CSS rule for the floating image
from position: absolute; to position: fixed; Once I did that, it worked
perfectly on Firefox. Yet it opened a bag of worms in IE because now in IE,
the online/offline status icon does not even appear anymore. You seem to be
quite knowledgeable about CSS and javascript. I will pay you to help me get
this working.
The site is [URL]
If you're interested in helping, do write back, and I'll provide whatever
info you need.
Kind regards,
Mike
From | Me |
To | Mike C |
Subject | Re: Position: fixed; related issue |
Date | 14 June 2007 09:48 |
Mike,
> Once I did that, it worked perfectly on Firefox. Yet it opened a bag of
> worms in IE
What version of Firefox?
What version of IE (bear in mind that IE 6 does not support position:fixed
but IE 7 does)?
Please test in Opera 9 and tell me if it works there:
http://www.howtocreate.co.uk/sendEmail.php#testbrowsers
> I will pay you to help me get this working.
http://www.howtocreate.co.uk/aboutsite.html#funding
> The site is [URL]
Please provide me with either a static version of the page that demonstrates
the problem (this would be best), or provide me with a login and further
instructions so I can test this for myself.
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
From | Mike C |
To | Me |
Subject | Re: Position: fixed; related issue |
Date | 14 June 2007 09:58 |
Attachment | PHP file |
Firefox version 2.0.0.4
IE version 6.0.2900.2180
I do not have Opera on my system.
You can log in to the live chat script here:
[url]/login.php
login is [username]
password is [password]
Click on the traffic monitor button in the upper right.
Once you're logged in there, you can go here for an empty page with just the
live chat icon on it:
[URL]/test.html
When you see yourself arrive in the traffic monitor, just click on your
listing in the table and go to actions, request chat.
You'll see the invite image float across the screen from right to left.
The goal is to get it to work on the [URL] site in both IE and
Firefox..
I've also attached the javascript.php file which contains the CSS rules and
other functions. Please let me know if you need anything else. If anything
it should be a challenge for you! :)
Thanks so much,
Mike
From | Me |
To | Mike C |
Subject | Re: Position: fixed; related issue |
Date | 14 June 2007 10:06 |
> Firefox version 2.0.0.4
> IE version 6.0.2900.2180
> I do not have Opera on my system.
http://www.opera.com/download/
From | Mike C |
To | Me |
Subject | Re: Position: fixed; related issue |
Date | 14 June 2007 10:22 |
I downloaded and installed Opera. When I try to go to the traffic monitor,
it doesn't work, some weird undefinedundefinedundefined message in the
traffic monitor window... So can't really say much about your favorite
browser :-) Perhaps there's a setting off in the default install of Opera,
I don't know..I do know for a fact that I hardly get any site visitors at
all using Opera:
[yawn]
So I wasn't really concerned about it...Hope that doesn't offend ya
From | Mike C |
To | Me |
Subject | Re: Position: fixed; |
Date | 14 June 2007 10:25 |
So I logged into the traffic monitor with firefox and visited the dev site
with Opera. Sent the invite and it worked in Opera as it did in Firefox, so
it's just not working in IE (with the current CSS rules)
Mike
From | Me |
To | Mike C |
Subject | Re: Position: fixed; |
Date | 14 June 2007 10:44 |
Mike,
> I downloaded and installed Opera. When I try to go to the traffic
> monitor, it doesn't work, some weird undefinedundefinedundefined message
> in the traffic monitor window...
This shows that you have some bugs in your code that you really should try
to fix. Opera's JavaScript support is about the best in the browser
industry, and it's not Opera's fault that you are using a browser sniffer
that then sends Opera down the wrong code path is it?
> I do know for a fact that I hardly get any site visitors at all using
> Opera:
http://www.howtocreate.co.uk/nostats.html
But besides which, I ask you to test in it to save me debugging time. It's a
few minutes of your time, but it's far more of my time considering how many
people I help.
> So I logged into the traffic monitor with firefox and visited the dev site
> with Opera. Sent the invite and it worked in Opera as it did in Firefox,
> so it's just not working in IE (with the current CSS rules)
> Mike
Great, this shows you that you are probably using the CSS correctly, and it
is just IE that is messing up.
> IE version 6.0.2900.2180
As I said, IE 6 does not support position:fixed (it treats it as
position:static). IE 7 does. So basically your stuff should work in IE 7,
just not in IE 6. I have an article describing how to get it working in IE
6, but I recommend that you simply ignore it and ask IE users to
use IE 7.
http://www.howtocreate.co.uk/fixedPosition.html
> The goal is to get it to work ... in both IE and Firefox..
There are more than two browsers in this World, and you could play a part in
helping make the Web a better place if you support standards compliant
browsers (and use code branches for IE if needed), instead of just IE and
one standards compliant browser.
I really disapprove of this idea of supporting just two browsers - it's not
1997 any more.
From | Mike C |
To | Me |
Subject | Re: Position: fixed; |
Date | 14 June 2007 15:56 |
The phplivehelper code is not mine. I bought it from [URL]
[Ed. Firstly, my contact page says I do not offer to help implementing
other people's scripts. Secondly, if you bought something, then you should
be asking them for help, not me.]
I'm not a programmer or even a web designer by any means. I don't know what
a browser sniffer is either. Yes it would be nice for everything to work in
all browsers, yet I'm not a programmer, I don't know this stuff. And I am in
business to make money and provide for myself and my family. Since the vast
vast majority of the world still uses IE, I am most interested in getting it
to work in IE first and foremost. Then when there is time, sure, I'd like
to go back and try to make it work for as much as the viewing audience as
possible. Your arrogance isn't appreciated. We're not all as smart as you
and we don't all have the programming skills to make our websites perfect
for Opera and every browser. It isn't easy and that is why I sought out
help. But it appears you're on some kind of high horse or something. So
thanks for making me download a web browser that I don't like and that no
one (that comes to my site anyways) uses. I considered that a waste of
time. I asked for help with IE and firefox, yet it seems you have your own
agenda. Take care..
From | Me |
To | Mike C |
Subject | Re: Position: fixed; |
Date | 14 June 2007 16:45 |
Mike,
I am not trying to get on any high horse. I am trying to instill a sense of
responsibility in you. Your site does not work where it should. Whether or
not you like a browser is irrelevant. I do not like IE, but I still make
sites work in it. I do not like Firefox, but I still make sites work in it.
You don't have to like a browser. You just have to make your pages work in
it.
That is your responsibility as a Web developer. To make pages that work in
browsers that take the time to follow the standards set out by the World
Wide Web Consortium. Whether you accept that responsibility or not is simply
up to you, and of course I cannot force you. However, I will not offer my
time to help anyone who does not want to take the time to help me to help
them.
That means testing in the browsers that I ask you to test in, because
testing in multiple browsers allows us both to see where you are relying on
a non-standard behaviour of one browser, or you have hit on a bug in
another. By testing in Opera as well, you showed me that the bug was in IE.
You could have used that information yourself as well, and hopefully you
will learn that good development means testing in multiple browsers to help
locate the browser that is at fault.
However, you have chosen to be ungrateful instead of accepting education.
You asked me to locate the cause of a problem. I located the cause of the
problem (you are using some CSS that IE 6 does not support, and yet you want
it to work in IE 6). I have answered your questions, but you seem to have
chosen to ignore my answers. Now you could do us both a favour by swallowing
your pride, and using the information I have provided you with to and fix
your site. Alternatively, you could continue in your ignorance. It is your
choice.
If you need to contact me for further help, please ensure you follow the
guidelines on my contact page.
> I don't know what a browser sniffer is either.
It is where you detect a browser based on its name (or some other
information), and you then decide what it is capable of, based only on what
you think it is capable of, based on its name. Your code in this file uses
it, and fails because it does not use proper code branches for the browsers
that it has detected (it also gets it wrong in Safari 3, which it seems to
think is Gecko, when it isn't):
[url].js
If you are not the author of that script, then you should contact the author
and ask them to fix it, especially since you have paid them for a piece of
code that does not work properly.
From | Mike C |
To | Me |
Subject | Re: Position: fixed; |
Date | 14 June 2007 16:57 |
Well I am sorry if I was rude then, perhaps you didn't understand that I'm
NOT a web developer. I don't know all the ins and outs of CSS. I'm creating
a site using a content management system for the very reason that I don't
know all this stuff. When I run into a glitch, I ask for help. If I as a
tech savy programmer guy like you, then yes, I would be interested in having
the site work in all the web browsers (although there are a lot of them out
there too besides Opera, dozens I'm sure.) Perhaps stats don't matter, but
it's so rare that I even see Opera in the stats. I'm sure it's great and all
but I have to cater to the demographic of my site which is older people who
probably don't even know about anything but IE for the most part. They're
not tech savvy and neither am I. I knew the problem was the fixed rule.
That's why I [searched for] "position: fixed;" IE and your site came up. I
was looking for help in what to do as a workaround..
[Ed. Then an extra "ARGH!" is required. On that page, I quite clearly state
that the script is no longer supported, and I do not offer to help you get
it working. I do wish people would learn to read before they contact me.]
From | Mike C |
To | Me |
Subject | Re: Position: fixed; furthermore.. |
Date | 14 June 2007 17:00 |
Furthermore, just so you know, I am highly aware of being standards
compliant. My main work is in DVD production and videography. If you don't
create something exactly to spec in the DVD world, then it doesn't work,
period. So I know all about having to follow strict guidelines, just not in
the web design world.
From | Me |
To | Mike C |
Subject | Re: Position: fixed; |
Date | 14 June 2007 17:13 |
Mike,
> I was looking for help in what to do as a workaround..
Does my article not explain it well enough?
http://www.howtocreate.co.uk/fixedPosition.html
I am sure I have explained it better in that article than I will be able to
do via email. But if there is any specific part you are unsure of, ask
me.
From | Mike C |
To | Me |
Subject | Re: Position: fixed; |
Date | 14 June 2007 17:28 |
Your article is very thorough, however, being that I'm not a web developer,
I don't understand how to apply any of it to my situation. If I did, I
wouldn't have written you and would have taken what you wrote and applied it
to my problem. :)
From | Me |
To | Mike C |
Subject | Re: Position: fixed; |
Date | 15 June 2007 10:57 |
Mike,
> Your article is very thorough, however, being that I'm not a web
> developer, I don't understand how to apply any of it to my situation.
I see, so you are asking for help implementing what I said in the article,
[Ed. Even though it clearly says I no longer support it...]
not to locate the cause. Right. Onwards.
[URL].css
This looks like an attempt to emulate fixed positioning in IE 6 (I am
guessing this one was done by the authors of the tool, but it will help to
show you what it is that you need for your own code):
#loaderContainer {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
position: expression('absolute');
height: expression(document.documentElement.scrollHeight+'px');
width: expression(document.documentElement.scrollWidth+'px');
z-index: 1000;
}
Nearly there. The IE expressions are right for what they are doing, except
that they also need to add these two to make IE take scrolling into account:
top: expression(document.body.scrollTop+'px');
left: expression(document.body.scrollLeft+'px');
This will work effectively the same as position:fixed; assuming the element
called "loaderContainer" is not put inside any other element that has
position:absolute or position:relative. (Note that it also forces IE 7 to
use the hack, even though it could work with real position:fixed; but that
is harmless, so don't worry about it.)
Now to where I think you have tried to use fixed positioning. You seem to
have put this line inside your javascript.php file:
proactive += '#imageObject { visibility: hidden; position: fixed; top: 400;
left: 400; z-index: 5000; }';
Basically, you want the same effect there. So you need to add the
expressions inside that long string, so that single line becomes this
instead:
proactive += '#imageObject { visibility: hidden; position: fixed;'+
' top: 400px; left: 400px; z-index: 5000;'+
' position: expression(\'absolute\');'+
' top: expression((400+document.body.scrollTop)+\'px\');'+
' left: expression((400+document.body.scrollLeft)+\'px\');'+
' }';
Change the extra "400"s if needed to allow for any differences. Note that I
put the expressions together based on the fact that you have no <!DOCTYPE>
at the top of your document (meaning it uses quirks mode rendering). If you
ever choose to add a doctype and the effect stops working, you will need to
change "body" to "documentElement".
These are the only places that I have seen fixed positioning used on the
parts of the site that you have shown me, so I hope that together, these
will get it working the way you want. If not, you will need to contact the
authors of the tool, and ask them how to do what you want.
From | Mike C |
To | Me |
Subject | Re: Position: fixed; |
Date | 15 June 2007 20:35 |
Here's what I did:
I opened plh.css file and changed the rule to this:
*#loaderContainer {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
position: expression('absolute');
height: expression(document.documentElement.scrollHeight+'px');
width: expression(document.documentElement.scrollWidth+'px');
top: expression(document.body.scrollTop+'px');
left: expression(document.body.scrollLeft+'px');
z-index: 1000;
}*
I then opened javascript.php and changed to this:
*proactive += '#imageObject { visibility: hidden; position: fixed;'+
' top: 400px; left: 400px; z-index: 5000;'+
' position: expression(\'absolute\');'+
' top: expression((400+document.body.scrollTop)+\'px\');'+
' left: expression((400+document.body.scrollLeft)+\'px\');'+
' }';*
After I made those two changes, here are the results:
Firefox - The chat invite works, image floats across screen correctly when
initiated.
Opera - The chat invite works, image floats across screen correctly when
initiated.
IE6 - (big surprise) chat invite image does not appear or scroll
across, but the online/offline status icon is now visible and functional so
that's a plus for sure.
Did I miss anything in your instructions? Having the functional status icon
working on all 3 browsers is definitely good! Any other tricks up your
sleeve for IE6 on the floating invite image?
Thanks,
Mike
From | Me |
To | Mike C |
Subject | Re: Position: fixed; |
Date | 15 June 2007 22:09 |
Mike,
> IE6 - (big surprise) chat invite image does not appear or scroll
> across, but the online/offline status icon is now visible and functional
> so that's a plus for sure.
It worked for me in IE 6, but only if IE 6 was the _only_ browser I had
running with the page open waiting to receive the invite. Seems the invite
can only be received by one browser at a time. Took about 10 seconds for the
invite to appear.
Make sure that IE 6 is the only browser that you have open showing the test
page, then use Firefox to send the invite to IE 6. If it still fails to work
for you, the only thing I can assume is that there is a bug in the system,
and you should contact the authors of it and ask them for help.
> Did I miss anything in your instructions
Nope, you followed them perfectly.
From | Mike C |
To | Me |
Subject | Re: Position: fixed; |
Date | 15 June 2007 23:15 |
Weird, it's not working for me in IE6 at all.. I closed the other browsers
like you said. But still no floating invite image like in firefox and
Opera..I wonder why it is working in your IE6 and not mine now..
From | Me |
To | Mike C |
Subject | Re: Position: fixed; |
Date | 15 June 2007 23:34 |
Mike,
> Weird, it's not working for me in IE6 at all
Ok, well, I see nothing at all in the code that could cause that effect. But
I do not know the code as well as its authors. Perhaps they know something
that I do not.
One possibility is that your IE install is broken (perhaps its ActiveX is
not working due to some overly high security setting). To be honest, you
really should get off IE 6 as soon as possible anyway, it is a serious
security risk. If you still want to test your site in IE 6 after upgrading
to IE 7, you can use the TredoSoft installer:
http://www.howtocreate.co.uk/ie7.html#packageie7