javascript - Jquery bind 'copied' event -
i'm using bootstrap's popover component display bit of text copied user. need make popover disappear after user has copied text.
so far had tried:
$('.popover-content input').select().bind('copy', function () { $('#link').popover('hide'); });
the problem copy event seems run bound function before clipboard contents updated. means when copy triggered popover dom element has been destroyed along text field.
i had thought set popover css display: none;
doesn't feel tidy or elegant way of performing action.
does know if there 'copied' event or other way of doing cross browser.
use unbind()
method:
$('.popover-content input').select().bind('copy', function () { $('#link').popover('hide'); $(this).unbind('copy'); });
Comments
Post a Comment