2017-12-21 9 views
0

클릭시 DOM을 변경하고 싶습니다.클릭시 액체 변수 변경

--- 
layout: pastTournaments 
title: Google Tournament 
permalink: /tournaments/google/ 
--- 

<h5 class="column-wrapper centered">These are the rankings for the Google Qualifying tournament, which was hosted on December 2, 2017.</h5> 
<br> 
<div class="column-wrapper"> 
    <div class="grid-x"> 
     <div class="large-6 shrink cell"> 
      <table> 
       <thead> 
        <tr> 
        <th width="20" class="centered">Rank</th> 
        <th width="150" class="centered">Team Number</th> 
        <th width="150" class="centered">Team</th> 
        <th width="50" class="centered">QP</th> 
        <th width="50" class="centered">RP</th> 
        <th width="50" class="centered">Plays</th> 
        </tr> 
       </thead> 
       <tbody> 
        {% assign sorted = site.data.google.teams | sort:"rank" %} 
        {% for team in sorted %} 
         <tr class="table" onclick="ranks()"> 
          <td class="centered">{{ team.rank }}</td> 
          <td class="centered">{{ team.number }}</td> 
          <td class="centered">{{ team.name }}</td> 
          <td class="centered">{{ team.qp }}</td> 
          <td class="centered">{{ team.rp }}</td> 
          <td class="centered">{{ team.plays }}</td> 
         </tr> 
        {% endfor%} 
       </tbody> 
      </table> 
     </div> 
     {% for team in site.data.google.teams %} 
     <!--I want to remove this if tag because it is specific to one team--> 
      {% if team.name == 'Q' %} 
       <!--I want to move this line --> 
       <div class="large-6 shrink cell"> 
        <h2 class="centered"><strong>{{ team.number }} {{ team.name }}</strong></h2> 
        <h4 class="centered"><strong>Rank: </strong>#{{ team.rank }}</h4> 
        <p class="centered"><strong>QP: </strong>{{ team.qp }}</p> 
        <p class="centered"><strong>RP: </strong>{{ team.rp }}</p> 
        <p class="centered"><strong>Plays: </strong>{{ team.plays }}</p> 
        <div id="ranks-right"></div> 
       <!--To this line --> 
       </div> 
      {% endif %} 
     {% endfor %} 

    </div> 
</div> 

가 {{team.name가}}를 클릭 팀에 설정 될 수 있도록 내가 필요 : 여기 내 액체 (google.md)입니다.

+0

동일한 데이터를 두 번 인쇄하려는 이유를 이해할 수 없습니다. –

+0

나는 그것을 옮기고 싶지 않다. –

답변

0

클릭시 지킬 변수를 설정하려고합니다. 이건 불가능 해. 지킬이 어떻게 작동하는지 완전히 이해하지 못하고 있습니다. 거의 다 왔지만 ... 실종 된 것은 변수가 빌드 중에 만 설정된다는 것입니다. 클릭에서 DOM의 내용을 변경하려면 javascript를 사용해야합니다. 액체는 당신을 도울 수 없습니다. 죄송합니다.

+0

좋아,하지만 그걸하는 법을 아십니까? –

+1

나는 당신을 기꺼이 도와 줄 것입니다. 그러나 먼저 직접 시도해보고 새로운 질문을하여 문제가 무엇인지 설명하십시오. – JoostS