Navigation

    APPDRAG Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular

    REMINDER

    Please be respectful of all AppDragers! Keep it really civil so that we can make the AppDrag community of builders as embracing, positive and inspiring as possible.

    Executing script after appdrag.js

    Cloud CMS (Pagebuilder, Blog, Shop, Newsletters, Code Editor)
    2
    4
    281
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Pierre SULPICE
      Pierre SULPICE last edited by

      Hello,

      I would need to execute code once appdrag.js is done executing.
      Is there any way to check when it's done to then call my own script ?

      A basic exemple of why I need that :
      Let's say I want a code to adapt margins on 3 sections to make them overlap using jQuery, my script will (might ? But will in all my tests) be executed be fore appdrag.js is done, but appdrag.js will apply the margins pagebuilder it seems, erasing my margins.

      The dirty hotfix I'm using right now is putting that wanted code in a setTimeout of 0 seconde, which it seems push back the execution after appdrag.js is completed.... but it's most likely a little unstable and random to do that ^^"

      Thank you,
      Best regards,

      1 Reply Last reply Reply Quote 0
      • Wassim
        Wassim last edited by

        Hi,

        When you use a jQuery source code block you can see the event once jQuery is loaded through AppDrag.

        b8ebf400-2af1-42d8-80ff-9eff871a85c8-image.png

        But you're right you might be overridden every time the resolution change and marginAndPadding are applied. To avoid it you can remove the class dynamic-sized-element and you item won't be changed by the resizing system.

        Pierre SULPICE 1 Reply Last reply Reply Quote 0
        • Pierre SULPICE
          Pierre SULPICE @Wassim last edited by

          @Wassim thanks for the answer 🙂

          Given your solution, it means the resize/margin/padding is the ONLY thing that will be changed by appdrag.js ?

          The solution isn't ideal, there is an example why :
          If I want to overload the resize depending the size of the screen, it'll be bad if I remove your resize upfront I guess, if I want to use yours in some circumstances ?

          See you soon,
          Best regards,

          1 Reply Last reply Reply Quote 0
          • Wassim
            Wassim last edited by

            On dynamic-sized-element yes it is only margin/padding and width (when you define margins on columns)

            Then if you want to override AppDrag sizing you can adjust the attributes
            margin-resolution-position ex: margin-desktop-top
            padding-resolution-position ex: padding-mobile-bottom

            And then call AppDrag method on the single element

            resizeMarginAndPaddingForElemJS($('yourDiv')[0]);
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post