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

Setting custom background to center, and "locked" during scrolling.

The topic basically tells what im looking for, i have implemented this javascript on load on the startscreen:

$('div[dsid="mobilecontainer1"]').css('background-image',
'url('+Appery.getImagePath('seaking.png')+')');

it works great, but it only shows the top left of the background. I want it centered- also when "scrolling" - the background should stay static and locked.

What can i add to fix this?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Setting custom background to center, and "locked" during scrolling.

Hi Lars,

Add this CSS code:pre[name=mobilecontainer1]{
background: url("http://example.com/image.png") no-repeat 50% 50% fixed;
}/preIf you need to change dynamically you can use the same approach in JavaScript.

Return to “Issues”