background-position

Fix for background-position in IE

I get this problem in IE7 when running a piece of code that uses jquery and 2 jquery plugins. The code works in FF3 and Chrome. The full error is: Line: 33 Char: 6 Error: bg is null or not an object Code: 0 URL: http://localhost/index2.html However line 33 is a blank line. I am using 2 plugins: draggable and zoom. No matter what...

IE6 background-position(?) issue

I apply to stackoverflow as my last resort. I got this ie6 bug while using the image at the background of the link. It seems that ie6 scrolls the background. How can I avoid it? At some width it shows like this: And at some other it shows like that: IE7 & FF show this just like I expect: The links are placed inside the div which i...

changing an element's background using the CSS property

Hello guys, I have a div with a background, and I'd like to change the background's position on click. This is my jQuery snippet : $('#sprite').click(function() { $(this).css('backgroundPosition','-40px'); }); While this is working ok, I'd like to return to the original position with a 'second' click, resetting all. Mmm, is thi...

Background Image in Div on Right Border in IE6

Help I try desperately to place a background image on the right border in a DIV in Internet Explorer 6. No success so far. This is my CSS: .test { width: 100px; border-right: red thin solid; border-top: red thin solid; border-left: red thin solid; border-bottom: red thin solid; background-position-x: 100%; ...

CSS/Javascript How do I make this background-position movie in Firefox like it does in IE7+?

<script language="javascript" > var speed=25; //speed var num=0; var photos = document.getElementById('head_image'); function scrollBG() { num++; photos.style.backgroundPosition="0"+num; } setInterval('scrollBG()',speed); </script> This is the site in question: www.theorymarine.com ...

CSS background: set position then do a shift?

The background-position property can be set in a variety of ways such as "top right" or "16px 16px" or "50% 75%" etc. Question: is there a way to position a background image then offset that position? For example: set the background-position to "top right" then shift it left 16px and down 16px using "-16px 16px"? ...

CSS background-position: animating and performance

I've seen many examples for animating the background-position of elements to produce nice looking scrolling backgrounds. These examples tend to also script in reset counters to put the background-position in its original location after a certain amount of pixels. My question is: Is it feasible to never reset the background-position for...

Change background position with jQuery

Hi! I'd like to change the background position of a CSS-class while hovering a li-element. HTML: <div id="carousel"> <ul id="submenu"> <li>Apple</li> <li>Orange</li> </ul> </div> CSS: #carousel { float: left; width: 960px; height: 360px; background: url(../images/carousel.png); } Any sug...

inline div background not showing up

I'm trying to use two divs, one with a non repeating background in the left corner to serve as a 'curved border' image, and the second div, within that one, with a background that is offset by the width of the first div's image so that it seems to be one solid image, that fluidly stretches with the page width. I tried doing this the way...

CSS: background-position: ???;

Hopefully these diagrams explain what I'm after. The red signifying the background and the grey the webpage. Wrong Right How do I achive this? I've tried background-position: bottom right; but it's just all wrong. ...

Adding amount to background-position on click (jQuery)

Hey, I pretty new to js and jquery so please bear with me. I'd like to change the background-position and add 1% on #div1 while clicking on #button1 and take -1% on #div1 while clicking on #button2 How could i achive this in jQuery? Alse, bonus question: These are going to get dynamically generated through php. Is it possible to use ...

Background positioning with jquery doesn't work in IE7

My script is supposed to dynamically change the background-position when clicking on a button (adding or substracting 1 percent from the current value). Works fine in Fx and Chrome, and ie8 too (i believe), though not in ie7. Here's my code: function makeClicker(index) { $('#leftbutton' + index).click(function() { var bPos ...

jQuery div hover function not working in Firefox

http://cambridgeuplighting.com/testimonials This code works in Safari, IE7, and IE8, but not in FF 3.5.7. The code changes the background of the little background icon when you hover over a div. jQuery(function( $ ){ $('.oneThird').hover(function(){ $(this).find('span.icon').css( {'background-position-y': '-60px'} ); }, function()...

How do I repeat part of an image using background-position and CSS sprites?

I would like to create some buttons with dynamic width using CSS sprites and background-position but I'm not sure if what I want is possible.. I would like the button to have a left-side, middle, and right-side, with the middle repeating as required. Ideally I would like this to be made up of one image of 11px wide so the left and righ...

How do I get just the x or y position of the background image using prototype?

Hey, I'm making a simple user friendly css editor using Prototype. Anyway, I was wondering whether I could get the background-position x/y values on their own? I wish I could do something like this but sadly it doesn't work: element.getStyle('background-position-x); I guess this is because position comes in different forms like 'center...

a:hover background-postition problem

For some reason, I am not entirely sure why, but the following is not working. The background position simply stays the same on hover. I cannot figure out why. I could do it another way, but I would like to try and get to the bottom of why it does not work. #nav a:link, #nav a:visited { background:url(../img/nav-sprite.png) no-repe...

CSS Put image at top of page

Hi, I need to have an image at the top-center of a web page in css. Now, Im just using the background-image: in css but this puts it at the middle of the page. Here's my code: body { background-image: url("theimageurlgoeshere"); //The image is 842 x 508 background-attachment:fixed; background-position: center top; background-...

jQuery background-position animation

Hi guys, I've created an image which is basically a CSS sprite of 3 images together. It's size is 278x123 so they are basically 3 images of 278x41. What I am trying to do is to make an animation of that by changing the background position. I've tried many things, one of my not very working solution is the following: var $slogan =...

jQuery .animate() not animating backgroundPosition in IE

I'm trying to animate a background image to move down a set amount of pixels but remain in the center of the page. Upon another click of an element I need it to move back to the top, but still remain in the center. Below is the current code: $(document).ready(function() { $('#email_campaigns').click(function(){ ...

CSS background-position not working in Mobile Safari (iPhone/iPad)

I have an issue with background-position in mobile safari. It works fine on other desktop browsers, but not on iPhone or iPad. body { background-color: #000000; background-image: url('images/background_top.png'); background-repeat: no-repeat; background-position: center top; overflow: auto; padding: 0px; margin: 0px; font-family...