• Resolved jasonbear

    (@jasonbear)


    Hello, Aaron,

    Absolutely great plugin . . . thank you!

    I’m trying to change the default slider position from .5 to .9 so that I can almost entirely hide the “After” photo by default. Unfortunately, I’m not having much luck. I edited the JS file (frontend-bundle.min.js), but the position did not change. Specifically, I changed “default_offset_pct:0.5” to “default_offset_pct:0.9”. Is there something else that I need to change? Perhaps, this could be a very handy additon to the module settings?

    Thanks again,
    Jason

    • This topic was modified 6 years, 1 month ago by jasonbear.
    • This topic was modified 6 years, 1 month ago by jasonbear.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Bolton Studios LLC

    (@boltonstudios)

    Hi Jason, Thank you! I appreciate your feedback. I will add the default slider position option in an update soon.

    You changed the correct setting: default_offset_pct

    Can you confirm that you have cleared any website caches? If you are using the Divi theme, please try clearing your Divi cache by going to Dashboard > Divi > Theme Options > Save Changes. Clicking the Save button on that screen should clear your Divi cache. Let me know if that is applicable and if it works after your clear your cache.

    Thread Starter jasonbear

    (@jasonbear)

    Hey, Aaron,

    Thanks for the quick response and info.

    Yes, I am using Divi.

    Unfortunately, my change from .5 to .9 is still not visually reflecting on the site. This is what I have tried so far, to no avail:

    * cleared AND disabled my site’s caching plugin, Comet Cache;
    * temporarily disabled the “advanced-cache.php” file;
    * in Divi settings, I toggled off “Minify And Combine Javascript Files” and then saved;
    * cleared my browser’s cache (Safari 12.0.2 for Mac OSX Mojave 10.14.2;
    * checked with Chrome browser, as well, just to confirm that it is not a Safari-specific issue.

    • This reply was modified 6 years, 1 month ago by jasonbear.
    Thread Starter jasonbear

    (@jasonbear)

    UPDATE: After further testing, I can now confirm that the change from .5 to .9 DOES visually reflect in Divi’s visual builder. Upon saving, however, that visual change does not reflect on the public page.

    Plugin Author Bolton Studios LLC

    (@boltonstudios)

    Ok, thank you for confirming. Here are the changes you can hard code to make this work.

    Make the following changes in before-after-image-extension.php.

    #1
    On line 43 of before-after-image-extension.php please change…

    jQuery( '.twentytwenty-container' ).twentytwenty();

    …to…

    jQuery( '.twentytwenty-container' ).twentytwenty({
        default_offset_pct: 0.9
    });

    #2
    On line 61, 62 and 64, please change maxWidth/2 to maxWidth*.9

    Finally, clear your cache and reload the page(s).
    Let me know if I those instructions are enough to go on or if I can elaborate, and if this fix works.

    Thread Starter jasonbear

    (@jasonbear)

    Success! Thanks. The change now reflects on the visual builder page AND the public page.

    FYI, I did not have to release the Divi cache for it to take effect.

    Do you know if this problem is limited to my particular install?

    Plugin Author Bolton Studios LLC

    (@boltonstudios)

    Great! I’m not quite clear about the problem you’re referring to. Can you rephrase/explain a bit more? There is no option in the plugin to change the default slider position at this time but you can edit the plugin files directly to alter the default slider position, and you can do that on any site. Just be sure to check the plugin changelog before you update the plugin in WordPress because your custom changes will be overwritten if you accept the update. I will most likely include this feature in the next update but please do glance at the changelog if you see an update available, especially if you make other file changes, just to confirm.

    Thread Starter jasonbear

    (@jasonbear)

    By “problem,” I just mean the issue that we just worked together to address/fix. I’m just wondering if it was/is limited to my particular setup or does it affect everyone.

    Plugin Author Bolton Studios LLC

    (@boltonstudios)

    @jasonbear Ohh ok, yes, the lack of a default slider position option affects everyone. It’s not just you. However, I expect to add the feature in an update soon.

    To resolve it in this case, we made changes to force the default slider position to change in frontend-bundle.min.js (for the backend Visual Builder) and before-after-image-extension.php for the front-end.

    Plugin Author Bolton Studios LLC

    (@boltonstudios)

    @jasonbear I added a setting to the Visual Builder module under Advanced > Attributes where you can set the Default Slider position. I based the new setting on the code we discussed earlier in this thread. Note that updating the plugin will overwrite and erase your customizations, so I recommend creating a back-up just in case. Please feel free to let me know how version 1.2.1 works for you. Thanks!

    Thread Starter jasonbear

    (@jasonbear)

    Works like a charm now. Thanks, Aaron!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Default slider position’ is closed to new replies.