2
目的:フォーム内のアイコンをクリックすると、フォームを含むdivに新しいクラスを追加します。 問題:プルアップ内のJquery selectorが要素を選択していません。 Console.log result of Jquery sector in this image.要素がフェッチされないため、addAclassは機能しません。 私がやっている間違いを理解していただけますか?事前におかげJquery SelectorがPolymerでdiv要素を見つけることができません。わかりやすい問題を理解していない
HTML
<div class="sidepullup" id="idSidePullup">
<iron-icon class="cross" on-click="pullupClose" icon="close"></iron-icon>
<iron-form id="idForm">
<form action="/">
<paper-input type"text" label="First Name"></paper-input>
<paper-input type="text" label="Last Name"></paper-input>
<paper-input type="text" label="Title"></paper-input>
<paper-input type="text" label="About"></paper-input>
<paper-button style="background-color: #03a9f4; color: white" raised onclick="onFormSubmit()">Submit Changes</paper-button>
</form>
</iron-form>
</div>
スクリプト
<script>
class IronListClass extends Polymer.Element {
static get is() {return 'iron-comp'}
ready() {
super.ready();
var that = this;
}
pullupClose() {
var element = $("#idSidePullup");
console.log('console log of $("#idSidePullup") = ', element);
$("#idSidePullup").addClass('hidePullup');
$("#idSidePullup").css("display", "none");
}
window.customElements.define(IronListClass.is, IronListClass);
</script>
ありがとうございます。試してみてください。 –
ありがとうたくさんの男。出来た!!これはあなたがポリマーでどうやっているか分からなかった。これは現在閉鎖することができます:) –
問題がなければ、完了したら回答としてマークしてください。 :) – magreenberg