Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 为什么';当我在主要元素上有一个div(仍在列表中)时,我的铁元素列表项不会重置吗?_Html_Css_Polymer_Polymer Elements - Fatal编程技术网

Html 为什么';当我在主要元素上有一个div(仍在列表中)时,我的铁元素列表项不会重置吗?

Html 为什么';当我在主要元素上有一个div(仍在列表中)时,我的铁元素列表项不会重置吗?,html,css,polymer,polymer-elements,Html,Css,Polymer,Polymer Elements,我有一个包含一堆对象的铁链表,我希望它们在发生事件时重新定位,该事件会更改铁链表的输入数据。我需要每个对象引用列表的顶部,但还没有找到任何解决方案。我能让它们像绝对对象一样工作的唯一方法是在主项之前放置一个div,如下所示。但是当我更改数据时,项目的数量保持不变,只有一些(数组中新元素的数量)重新定位。如果以前的数据中还有更多的项,那么即使我绑定了要从数据中读取的高度,这些项仍会保留在原来的位置 <iron-list id="myID" items="[[myInput]]"

我有一个包含一堆对象的铁链表,我希望它们在发生事件时重新定位,该事件会更改铁链表的输入数据。我需要每个对象引用列表的顶部,但还没有找到任何解决方案。我能让它们像绝对对象一样工作的唯一方法是在主项之前放置一个div,如下所示。但是当我更改数据时,项目的数量保持不变,只有一些(数组中新元素的数量)重新定位。如果以前的数据中还有更多的项,那么即使我绑定了要从数据中读取的高度,这些项仍会保留在原来的位置

      <iron-list id="myID" items="[[myInput]]" as="myItem" selection-enabled multi-selection>
        <template>              

         <!-- I have to have this to get the main items to position referenced to the top of the iron-list -->
        <div id="referenceDiv" style="left:0px; float:left; width: 100%; min-height:1px; background-color:blue; top: 0px; display: none;"></div>

        <div id="mainItemID" style$="background-color:#FFF; height:[[myItem.height]]px; top:[[myItem.top]]px; border-radius: 3px; border-color:#333; border-width:1px; border-style: solid;;"></div>


       <div id="bottomGuidID" style="left:0px; float:left; width: 100%; min-height:1px; background-color:lightblue; top: 1920px;"></div>

        </template>
      </iron-list> 


style
之后的第三个
div
上有一个
$
符号,除非这是有意的(但我假设不是因为其他人都没有)。哦,我有一个计算参数,用来绑定我的身高,我认为在这种情况下需要$。虽然我已经去掉了那部分。不管怎样,都没有区别。。我在考虑回dom再说一遍!你在
style
之后的第三个
div
上有一个
$
符号,除非这是有意的(但我假设不是因为其他人都没有)。哦,我有一个计算参数,用来绑定我的身高,我认为在这种情况下需要$。虽然我已经去掉了那部分。不管怎样,都没有区别。。我在考虑回dom再说一遍!