• Resolved snippet24

    (@snippet24)


    After disabling criticalcss the portfolio JS section is broken, before I just re-enabled criticalcss and it then it was working fine again. But now as the license is expired that “fix” is no longer working. So this is the second time it happens I’m afraid and I don’t know how to fix it really. I do have set a conditional that only loads the JS and css for the slider in portfolio like this:

    <?php if( is_page( array( 'inicio','portafolio'))) { ?>
    
    <script defer src='https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/slick.min.js'></script>
    //more code
    <?php } ?> 

    will try changing that. Dind’t work… :/

    • This topic was modified 4 years, 4 months ago by snippet24.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter snippet24

    (@snippet24)

    Just to debug: deleting/cutting the api key string in an active criticalcss local installation, does it cause problems?

    Thread Starter snippet24

    (@snippet24)

    Is there a way to remove criticalcss data form a wordpress installation? I have tried everything at solving this with no fix.

    Update I’m getting a flash typical for render blocking optimization even though it is disabled ??

    • This reply was modified 4 years, 4 months ago by snippet24.
    • This reply was modified 4 years, 4 months ago by snippet24.
    Thread Starter snippet24

    (@snippet24)

    Javascript is being stripped away which is causing the slider to not appear as well as not detecting scroll the fixed shadow for the menu. Please confirm if you can recreate this possible bug.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    OK, general info first: disabling CCSS can indeed be done by either removing (changing) the API key or by disabling “inline & defer CSS”. doing so has not impact on your site’s JS.

    specifically for your site: I’m seeing Uncaught TypeError: $ is not a function errors, even when AO is disabled. In WordPress you should use jQuery() instead of $() really (more info and alternative approaches at https://premium.wpmudev.org/blog/adding-jquery-scripts-wordpress/).

    hope this helps,
    frank

    Thread Starter snippet24

    (@snippet24)

    Thank you so much you are right. Doing so fixed most of the errors, may I ask why is the slider still broken? it returns error
    Uncaught TypeError: jQuery(…).slick is not a function

    Thread Starter snippet24

    (@snippet24)

    Ok I removed the defer attribute and is working, but some stuff is just not working as expected still, I realize this may be beyond the scope of AO.

    • This reply was modified 4 years, 4 months ago by snippet24.
    • This reply was modified 4 years, 4 months ago by snippet24.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    typically what I do to determine whether an issue is due to Autoptimize or not is compare functionality on a given page with and without (by adding ?ao_noptimize=1 to the URL) AO active. if the problem persists with AO off, the root cause (and fix) is elsewhere indeed.

    Thread Starter snippet24

    (@snippet24)

    Understood!! Question why it worked when Criticalcss was active? Also if you don’t mind why are lines like

    jQuery(document).on("mouseenter", ".slick-current", function(e) {
      jQuery('.slick-current').addClass('current-hover');
    });
    jQuery(document).on("mouseleave", ".slick-current", function(e) {
        jQuery('.slick-current').removeClass('current-hover');
    });  
    
    // Para Touch 
    
    jQuery(document).on("touchstart", ".slide", function(e) {
      e.stopPropagation();   
      if(jQuery(this).hasClass('current-hoverv2')){
              jQuery(this).removeClass('current-hoverv2');
        }
        else{
             jQuery(this).addClass('current-hoverv2');
        } 
    });

    not working?

    • This reply was modified 4 years, 4 months ago by snippet24.
    • This reply was modified 4 years, 4 months ago by snippet24.
    Plugin Author Optimizing Matters

    (@optimizingmatters)

    don’t know I’m afraid ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Disabling/renabling Criticalcss causes weird issues’ is closed to new replies.