Selecting element (Polymer 1.0) -


i working on migrating polymer 1.0

here template:

<template>     <div class="scroll">         <div class="content">             <content></content>         </div>         <div class="bar bary"></div>     </div> </template> 

the content gets filled text in main html file.

i need scroll height of div. used do:

height = $(this.shadowroot).find('.content')[0].scrollheight; 

but isn't working anymore:

uncaught typeerror: cannot read property 'scrollheight' of undefined 

i tried adding id div, , selecting so:

height = this.$.content.scrollheight; 

but giving me value of 0, though there lots of text in content.

i calling code ready function.

am selecting element correctly?

<content> not contain component's contents, rather provides insertion point contents, siblings <content> element. elements inserted given <content> node, can use following:

var content = polymer.dom(this.root).queryselector('content'); var distributed = polymer.dom(content).getdistributednodes() 

documentation above can found @ https://www.polymer-project.org/1.0/docs/devguide/local-dom.html#dom-api-examples along more complete example.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -