0
const page = angular.element('#contact-history')
this.scrollContainer = page ? page.parent().parent().parent() : null
如何改進代碼,並採用了棱角分明1角1 - 提高angular.element /多個父()
的DOM避免多次parent()
,我想選擇overlay-content
ID:
<div id="overlay-content" class="overlay-content container-fluid ng-scope">
<h1><span translate="" translate-values="{ section: $ctrl.overlayTitle }" class="ng-scope">My Historie</span>
<ui-view class="ng-scope">
<contact-history contact="::$resolve.contact" class="ng-scope ng-isolate-scope">
<div class="row contact-history" id="contact-history">
</div>
</my-iad-contact-history>
</ui-view>
<div ui-view="overlay" class="overlay ng-scope"></div>
</div>
你想要什麼元素? – Jerinaw
@Jerinaw此加入 –
'this.scrollContainer =頁面? page.parents( '#DIV覆蓋內容'):null'?嘗試這個 ?希望你擁有jQuery的包括 – Rahul