Page 1 of 2

Background image-help needed

Posted: Fri Aug 29, 2014 8:08 am
by Tejwant

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


Background image-help needed

Posted: Fri Aug 29, 2014 9:58 am
by Evgene Karachevtsev

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.


Background image-help needed

Posted: Mon Sep 22, 2014 9:30 pm
by Mike6979865

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


Background image-help needed

Posted: Tue Sep 23, 2014 2:16 am
by Yurii Orishchuk

Hi Mike,

Here is code that you requested:

pre

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

/pre

Regards.


Background image-help needed

Posted: Fri Oct 24, 2014 5:02 pm
by Jason Baird

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?


Background image-help needed

Posted: Fri Mar 27, 2015 3:03 pm
by Nicklas

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


Background image-help needed

Posted: Sat Mar 28, 2015 5:08 am
by Illya Stepanov

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


Background image-help needed

Posted: Sat Mar 28, 2015 7:24 am
by M&M

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


Background image-help needed

Posted: Sat Mar 28, 2015 10:38 am
by Nicklas

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


Background image-help needed

Posted: Sat Mar 28, 2015 11:30 am
by Alena Prykhodko

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