Tejwant
Posts: 0
Joined: Fri Aug 29, 2014 8:08 am

Background image-help needed

Hi,
I am new to this area and am trying to create a custom background image.
I am testing using the tutorial help to create a custom background image, and even those 2 lines are giving a lot of errors. Can you help pls?
Thanks,
TK

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Background image-help needed

Hello Tejwant,

You should load image in Media Manager. On component: "yourPage", Event: Load Action: Run JavaScript
please paste this script:
preApperyio("mobilecontainer1").css("background-image", 'url('+Apperyio.getImagePath("image.jpg")+')')/pre
where image.jpg is the name of your picture.

Mike6979865
Posts: 0
Joined: Fri Jul 11, 2014 3:53 pm

Background image-help needed

How do I make the image resize automatically based on the screen size?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Background image-help needed

Hi Mike,

Here is code that you requested:

pre

Apperyio("mobilecontainer1").css({
"background-image": "url(" + Apperyio.getImagePath("image.jpg") + ")",
"background-size": "cover"
})

/pre

Regards.

Jason Baird
Posts: 0
Joined: Tue Nov 26, 2013 11:38 pm

Background image-help needed

Hi after reading this I chose to do this, what I'm finding is that I see the image load but then disappears? Any idea why?

Nicklas
Posts: 0
Joined: Thu Jul 03, 2014 8:51 am

Background image-help needed

Hello! I've tried this code (the first code above) for days now in different ways, but it still doesn't work form me.

Apperyio("mobilecontainer1").css("background-image",'url('+Apperyio.getImagePath("BackMenu.jpg")+')');

Can you give me a detailed explanation of how I do this?

I have putted this code in EVENT - MY PAGE - LOAD - Run JavaScript

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Background image-help needed

Hi Nicklas - Have you tried this code on the page show event?

M&M
Posts: 0
Joined: Tue Nov 11, 2014 6:59 am

Background image-help needed

Hi Nicklas,

You can put this in your css file

Remember to change to your mobilecontainer name, and also check the image name and path

code
[dsid="YourMobileContainerName"] {
background-image: url("../image/myImage.jpg");
background-repeat: no-repeat;
background-size: cover; /* comment this out if required */
}
/code
And remember to check if your image exists in this folder
WEB_RESOURCES - files - views - assets - image - myImage.jpg

This will work.

Cheers,
M&M

Nicklas
Posts: 0
Joined: Thu Jul 03, 2014 8:51 am

Background image-help needed

Thank you!
What is the path of the image if I have uploaded the image in "Media Manager"? is it just /image/myImage.jpg ?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Background image-help needed

Here you can find full path http://prntscr.com/6mcsbl/direct

Return to “Issues”