• Resolved Ed777

    (@d7fox7vr)


    How to add an image to the drop-down list? Or in which of the blocks can I insert a photo?

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter Ed777

    (@d7fox7vr)

    Sent by mail. Waiting for an answer!

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @d7fox7vr

    We’ve updated the JS script with the following one:

    (function ($) {
        
      $(document).ready(function () {
        
        function forminator_switch_select_background ( elem ) {
        let list_item = elem.find( '.forminator-dropdown-list li.current' ),
            target = elem.find( '.forminator-value' ),
            image = list_item.css( 'background' );
    
          target.css( 'background', image );
        }
        
        $(document).on( 'click', '.my-image-select-class-bymaga-wrap', function() {
          forminator_switch_select_background( $( this ) );
        });
    
        setTimeout(
        function() 
        {
          $( 'form.forminator-custom-form .my-image-select-class-bymaga-wrap' ).trigger( 'click' );
        }, 
        100
      );
        
      });
      
    })(jQuery);

    It should also show the images on page load too.

    That snippet uses a more general class “my-image-select-class-bymaga-wrap” which needs to be inserted in the “STYLING“ tab of the dropdown fields. We’ve added this class for select-9 and select-13 fields.

    Warm regards,
    Dimitris

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘How to add an image’ is closed to new replies.