Lars Holtet
Posts: 0
Joined: Sun Nov 24, 2013 5:47 pm

Make a background not repeat itself

Hi! I have set a custom background in my app, but if you scroll far down- it will repeat it self..

How and what do i add to the code to make it stop repeat iself?

This is my code:

$('div[dsid="mobilecontainer"]').css('background-image',
'url("img/bg3.png")');

Lars Holtet
Posts: 0
Joined: Sun Nov 24, 2013 5:47 pm

Make a background not repeat itself

I tried to add this:

$('div[dsid="mobilecontainer"]').css('background-repeat',
'no-repeat');

But then i only got a white background below the background pic when scrolling..

I want everything to be scrollable on the background :P

Lars Holtet
Posts: 0
Joined: Sun Nov 24, 2013 5:47 pm

Make a background not repeat itself

Solved! Complete code:

$('div[dsid="mobilecontainer"]').css('background-image',
'url("img/bg3.png")');

$('div[dsid="mobilecontainer"]').css('background-repeat',
'not-repeat');

$('div[dsid="mobilecontainer"]').css('background-attachment',
'fixed');

Return to “Issues”