Tagged: enfold, mobile background image
-
AuthorPosts
-
August 29, 2014 at 3:26 am #310756
Hi guys,
It was brought to my attention that on one of the pages of a site we created, the background image was still showing on mobile after doing a media query to remove on tablets and phones. After adding it and testing by sizing down our computer browser screen – it was not displayed after reaching the width assigned HOWEVER….. clients on phones were saying they could see it in the background. I confirmed this.
I set up a page mentioned in this post as a sample page with the background image. I have assigned it a css class of badge_bg.
What is the correct code to make this actually not display on mobile devices?
August 29, 2014 at 3:23 pm #310963Hi David!
Please add following code to Quick CSS in Enfold theme options under General Styling tab
@media only screen and (max-width: 768px) { #av_section_1 { background-image: none!important; }}
You can give your color section element a unique ID – http://kriesi.at/documentation/enfold/wp-content/uploads/sites/2/2013/12/color-section-ID.png and change #av_section_1 to your unique ID
Regards,
YigitAugust 29, 2014 at 4:15 pm #310977Hey there Yigit –
Still isn’t good. Looks fine on the computer if I size my screen down, then if I look on mobile……it is still there.
Also need to do the same for tablets.
Thanks again!
August 30, 2014 at 4:41 am #311153Hey!
Thank you for the update.
Please add the css snippet again. I guess it’s there on mobile device because of cache. Please remove the browser cache then reload the page a few times.
Best regards,
IsmaelOctober 20, 2014 at 11:02 am #338255Hi Ismael,
I have the same problem on tablets and mobile devices with firefox. Even after clearing the cache the background still shows on the whole page. I added the following css:
@media only screen and (max-width: 1024px) {
#contact { background-image: none!important; }}Did I miss something!
Thanks
GlennOctober 20, 2014 at 11:16 pm #338737Hi!
@glennbosch Can you post the link to your page please? Have you tried flushing browser cache on your mobile device?Regards,
YigitSeptember 7, 2016 at 3:43 pm #683206Can someone Please revert back with a solution to this problem. This is still a recurring problem.
Greatly appreciated
September 8, 2016 at 10:33 am #683598Hi @Diezel23,
Could you post a link to the site in question so that we can take a closer look please?
Regards,
RikardSeptember 8, 2016 at 10:52 am #683608Hi @Richard
ok I found the problem, for some reason on the mobile view – it adds an extra div.av-parallax, so the background image gets attached to this div and not the section. You cannot pick this up on the browser Inspector, need to inspect on a phone. So for anyone having this problem. this is the solution.
September 8, 2016 at 12:10 pm #683638Hi,
Please give your color section a unique #id and try adding this at the very end of your themes / child themes functions.php file:
NOTE: You may not see changes if you re-size the browser. The code is called when the page loads. If the page is opened in mobile device it removes the background images of the colorsection #ID’s listed.
// Remove color section background function remove_bg(){ ?> <script> jQuery(window).load(function(){ if (jQuery(window).width() < 768) { jQuery("#unique-id").css("background-image", ""); } }); </script> <?php } add_action('wp_footer', 'remove_bg');
Best regards,
Vinay- This reply was modified 8 years, 3 months ago by Vinay.
September 17, 2016 at 7:44 pm #687996Neither codes below worked for me when loading the page on a mobile device, it does work however when resizing chrome and reloading the desktop browser already resized. I did try different browser on the iphone (safari and chrome) and tried other phone type as well, no luck :(
@media only screen and (max-width: 768px) { #av_section_1 { background-image: none!important; }}
// Remove color section background function remove_bg(){ ?> <script> jQuery(window).load(function(){ if (jQuery(window).width() < 768) { jQuery("#unique-id").css("background-image", ""); } }); </script> <?php } add_action('wp_footer', 'remove_bg');
September 20, 2016 at 7:00 am #688959Hi,
I don’t see “unique-id” on the link you provided when i inspect the page. Have you applied a unique ID to the colorsection ?
Best regards,
VinaySeptember 20, 2016 at 7:08 am #688965we did, here is it
September 23, 2016 at 3:18 pm #690809Please post us your login credentials (in the “private data” field), so we can take a look at your backend.
Login credentials include:
- The URL to the login screen.
- A valid username (with full administration capabilities).
- As well as a password for that username.
- permission to deactivate plugins if necessary.
Best regards,
AndyNovember 19, 2016 at 5:00 pm #714362Hi
i had the same issue – and found half of the problem. when you select “scroll / srcolling” on the attribute drop down menu for the background image (in the color section) then it works fine on iphone display. BUT if you choose fixed or parallax it will be still deeing visible on iphone displays.check it out,
regards
sueNovember 23, 2016 at 3:58 am #715695Hi,
@Sue: Could you please provide a link to the page with the issue? If you set the background attachment to parallax, please use this css code.
@media only screen and (max-width: 989px) { #unique_id .av-parallax .av-parallax-inner { background-image: none !important; } }
Replace “unique_id” with the Section ID.
Best regards,
IsmaelJune 11, 2017 at 8:32 am #806499Hi,
I have tried the following code and it works perfectly when the image is set to parallax.
But it is important for me that the image is set to “fixed”, how must the code below be changed so that it also works with “fixed”?
I have tried anything. Thank you and best regards,
Martin
@media only screen and (max-width: 989px) {
#unique_id .av-parallax .av-parallax-inner {
background-image: none !important;
}
}June 14, 2017 at 1:51 am #807696Hi,
To hide the fixed background image of the color section in the mobile device please use the unique ID of the section. We have provided the example code below.
@media only screen and (max-width: 989px) { #unique_id { background-image: none !important; } }
Best regards,
VinayOctober 5, 2017 at 4:16 am #860382Hi there so this code was working for me, it’s still working for couple color sections.
Just added a new one here:that’s my code:
@media only screen and (max-width: 400px) { div#archi-workshop { background-image: none!important; } }I want the background not to show exclusively on mobile decides. The previous quick ccs codes are still working, but not this one. Any clue? I did clear all the caches and so on..
Thank you!
October 7, 2017 at 4:09 pm #861382Hi,
Try:@media only screen and (max-width: 426px) { div#archi-workshop- { background-image: none!important; } }
Best regards,
MikeOctober 12, 2017 at 12:55 am #863099Thank
October 12, 2017 at 12:20 pm #863366Hi,
Glad we could help :)
If you need further assistance please let us know.
Best regards,
VictoriaOctober 30, 2020 at 1:22 pm #1257045Hi Vinay,
I have tried your code for removing a fixed background image, cleared the browser cache on mobile, but the image is still there. Do you have any other idea?
Best regards,
EmeseOctober 30, 2020 at 1:28 pm #1257046Hi,
@marotiem for Vinay’s code above did you adjust it for the unique ID of your section? #unique_id@media only screen and (max-width: 989px) { #unique_id { background-image: none !important; } }
Please link to your example page so we can assist further.
Best regards,
MikeNovember 4, 2020 at 12:17 pm #1258216Hi Mike,
Of course I adjusted it for the unique ID. I posted the link in the private content area. On this page there is a section with a fixed background image. I want to keep it for laptops and remove it on mobile devices, as it covers the text and it’s unreadable.
Best regards,
EmeseNovember 4, 2020 at 12:38 pm #1258227Hi Emese,
Please add following code to Quick CSS in Enfold theme options > General Styling tab
@media only screen and (max-width: 480px) { #proconcoaching { background-image: none !important; }}
If that does not help and if you have other custom CSS codes, please check your CSS for errors using this website – http://csslint.net/.
If that is not the case, please create temporary admin logins and post them here privately so we can look into it.
Best regards,
YigitNovember 13, 2020 at 5:32 pm #1260373Hi Yigit,
I tried all what you’ve suggested but no results and no CSS errors. I gave temporary access to the following email address for 5 days: (Email address hidden if logged out) . If you could take a look, I would really appreciate it. The login URL is in the private content.
Best regards,
EmeseNovember 14, 2020 at 2:24 pm #1260489Hi,
Thank you for the login, I adjusted your css to this:@media only screen and (max-width: 480px) { #proconcoaching > .av-parallax { background-image: none !important; }}
Please clear your browser cache and check.
Best regards,
MikeNovember 16, 2020 at 2:29 pm #1260716Hi Mike,
It worked. Thank you very much!
Best regards,
EmeseNovember 16, 2020 at 2:42 pm #1260721Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Enfold > Background image > Remove on mobile’ is closed to new replies.