I\'m having a problem with non-displayed HTML elements being copied to the clipboard, and then displayed when the content is pasted into MS Word, Outlook, etc.
For e
Here is the solution I used to work around it.
The strategy:
Here are some notes:
whereHiddenThingsLive.find('.some-class')
.The code:
var whereHiddenThingsLive = $('');
var nextNum = 0;
function hideElement(element) {
if (element.hasClass('sop-showing')) {
element.finish();
}
if (element.is(':hidden') || element.hasClass('sop-hiding')) return;
var num = nextNum++;
element.addClass('sop-hiding');
element.slideUp(400, function () {
var replacer = $('').prop('id', 'hide-replacer-' + num);
element.prop('replaced-by', num);
element.after(replacer);
element.appendTo(whereHiddenThingsLive);
element.removeClass('sop-hiding');
});
}
function showElement(element) {
if (element.hasClass('sop-hiding')) {
element.finish();
}
if (element.is(':visible') || element.hasClass('sop-showing')) return;
element.addClass('sop-showing');
var num = element.prop('replaced-by');
element.detach();
element.removeProp('replaced-by');
$('#hide-replacer-' + num).after(element).remove();
element.slideDown(400, function() {
element.removeClass('sop-showing');
});
}