Will adding output from a stream item trigger a payment?

I have the following code that I need to make sure it is performance sensitive:

var $content = $(htmlString);

//Stop new element from triggering reflow? 
$content.css('display', 'none');

//add slide to DOM
$content.appendTo(options.els.$slider);

I can’t remember whether reflow is triggered by any manipulation of the DOM or if there are exceptions, such as adding a stream element to the DOM outside the element. Will the above code cause a re-melting if it options.els.$slideris in a stream?

+4
source share
2 answers

hidemethod (or css method , as the updated question shows) sets the property displayto none:

display: none;

, . , , visibility CSS:

$content.css('visibility', 'hidden');

display DOM, , .

, DOM repaint. Paint , Chrome .

+2

, , , - , . , DOM, , . .

+1

Source: https://habr.com/ru/post/1609833/


All Articles