Page 1 of 1

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

Posted: Mon Feb 17, 2014 12:59 pm
by Lars Holtet

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?


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

Posted: Mon Feb 17, 2014 1:39 pm
by Kateryna Grynko

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.