Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Input scrolling background in IE7
The problem
when the content of an input field is to much In IE7 , the background image scrolls with the text. This happens also in IE6 but by adding the rule background-attachment:fixed; you can solve it IE6.
If you do this in IE7 you lose the background image completely.
A solution (hmmm :-/ but not thee solution)
At the moment the only way i can avoid this issue is to add an extra wrapper and assign that the background-image. I am working on a rather large dynamic webapplication and i’d rather not go this route just for IE7
A better solution?
Is there a way that you guyz know to make that blessed background behave in IE7
I think, therefore I AM, … … er … I think :-?
Offline
Re: Input scrolling background in IE7
A work around.
Setting the CSS property background-position:100% 0; ensures that when typing the image always remains in view. The down side is that if the input starts with to much content (i.e. the initial value is contains more content than the width allows to show), then the background starts out of view!
A work around the work around ?^^
A little Jquery jiggery pokery may helps matters.
$(document).ready(function(){
if($.browser.msie) { // see if browser is IE
$("input.text").click(
function () { //solve IE BG image bug partially
$(this).css("background-position","100% 0");
}).blur(
function(){
$(this).css("overflow","hidden");
// $(this).css("background-position","0 0");
});
}
});
It’s nearly there. All needs is when the input is blurred that the cursor first moves to the beginning of the input field then you could use the second declaration in the .blur() function. But i don’t know if that is possible :-?
Last edited by Timid&friendly (2009-05-28 09:33:24)
I think, therefore I AM, … … er … I think :-?
Offline