SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

set background image for grid

I want to set the background image for a grid but it's not working. The following works to set the mobilecontainer background:

Apperyio("mobilecontainer").css("background-image", 'url('+Apperyio.getImagePath("header_bg.png")+')');

But if I try to set the grid background using:

Apperyio("mobilegrid_28").css("background-image", 'url('+Apperyio.getImagePath("header_bg.png")+')');

It's doesn't work. Is there a way to set the background of a grid (or a grid cell)?

Thanks!

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

set background image for grid

Hello Steve,

Please set the background image using the CSS instead of JS for that, like:
pre[name="mobilegrid_26"]{
background-image: url("../img/myTest.png");
}/pre

here "myTest.png" - the name of the image you want to use
"mobilegrid_26" - the name of the grid

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

set background image for grid

Awesome!

I added the "background-repeat: no-repeat;" and the "background-size: cover;" and it worked like a charm!

Thanks!

Return to “Issues”