/    Sign up×
Community /Pin to ProfileBookmark

Rollover background positioning

Hey guys and thank you for reading

Here’s my problem:

I’m making a new website for a friend which you can find here:

[url]http://grobowski.neys.dk/[/url]

As you can see on the indexfile when you mouseover the “Liv i Børnehøjde” buttons a yellow background goes up and goes down again when you mouseout. So far so good.

Now for those of you unfamiliar with the language on the website, it’s Danish and the “Liv i Børnehøjde” buttons are right now just placeholders for news items.

The problem:
I’d like the first news item (the little guy with the gun) to always have a yellow background except when I mouse over one of the other newsitems. Then it should go white. And ofcourse return to yellow if I mouse out on the other newsitem(s) again.

Hope you get what I’m trying to do, if not, please say so and I’ll try to explain it in another way.

Here’s the javascript code that’s on the site right now, changing the button-backgrounds:

[CODE]$(function(){
$(“.box .boxtext”)
.css( {backgroundPosition: “0 0″} )
.mouseover(function(){
$(this).stop().animate({backgroundPosition:”(0 -475px)”}, {duration:300})
})
.mouseout(function(){
$(this).stop().animate({backgroundPosition:”(0 0)”}, {duration:300})
})
});[/CODE]

Thank you for your time ?

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @neys spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...