Skip to content

reattach event handler after a jquery .html() #276

Description

@olvani

Your script works fine when loading a page but when we refresh the list of elements with .html() after call ajax, I attach again the event after but everything does not work properly like the ondrop.

$ ( "# Listeelements") html (response).

//this click below linked on the element about delete works
$ ('. BtnImageDelete'). On ('click', function (event) {
....
});

//this sortable below linked on the element about sort works badly
//the drag works but the drop zone is not displayed and the element does not intercalate. Once //released it returns to its original position.

var group = $ ('#sort-it ol.ollp') sortable ({
group: 'ollp',
delay: 500,
onDrop: function (item) {
onDropImage (item, group);
}
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions