Viewing 30 posts - 1 through 30 (of 30 total)
  • Author
    Posts
  • #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?

    #310963

    Hi 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,
    Yigit

    #310977

    Hey 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!

    #311153

    Hey!

    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,
    Ismael

    #338255

    Hi 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
    Glenn

    #338737

    Hi!


    @glennbosch
    Can you post the link to your page please? Have you tried flushing browser cache on your mobile device?

    Regards,
    Yigit

    #683206

    Can someone Please revert back with a solution to this problem. This is still a recurring problem.

    Greatly appreciated

    #683598

    Hi @Diezel23,

    Could you post a link to the site in question so that we can take a closer look please?

    Regards,
    Rikard

    #683608

    Hi @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.

    #683638

    Hi,

    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, 2 months ago by Vinay.
    #687996

    Neither 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');
    #688959

    Hi,

    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,
    Vinay

    #688965

    we did, here is it

    #690809

    @kilimats

    Please 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,
    Andy

    #714362

    Hi
    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
    sue

    #715695

    Hi,

    @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,
    Ismael

    #806499

    Hi,

    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;
    }
    }

    #807696

    Hi,

    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,
    Vinay

    #860382

    Hi 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!

    #861382

    Hi,
    Try:

    @media only screen and (max-width: 426px) { div#archi-workshop- { background-image: none!important; } }

    Best regards,
    Mike

    #863099

    Thank

    #863366

    Hi,

    Glad we could help :)

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1257045

    Hi 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,
    Emese

    #1257046

    Hi,

    @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,
    Mike

    #1258216

    Hi 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,
    Emese

    #1258227

    Hi 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,
    Yigit

    #1260373

    Hi 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,
    Emese

    #1260489

    Hi,
    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,
    Mike

    #1260716

    Hi Mike,

    It worked. Thank you very much!

    Best regards,
    Emese

    #1260721

    Hi,
    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

Viewing 30 posts - 1 through 30 (of 30 total)
  • The topic ‘Enfold > Background image > Remove on mobile’ is closed to new replies.