2017-10-12 8 views
-1

콘텐츠가 길어서 일부만 표시하고 싶을 때 '더 읽기'를 클릭하면 전체 콘텐츠를 표시하고 싶습니다. 버튼을 'read more'에서 'less read'로 변경하고 'read less'에서 'read more'로 버튼을 변경하십시오. 어떻게해야합니까? 내가 아래에있는 내 코드, 모든 버튼을 클릭 할 때마다 두 가지 기능을 전환하고 싶습니다.

지금, 나는 '적은 읽기'에 '자세히보기'로 전환 할 수 있어요하지만 난 '읽기에서 전환하는 방법에지고 있지 않다

$(document).ready(function(){ 
 
    $("#click-me").on("click", function(){ 
 
    $(this).html("Read Less"); 
 
    $(".content").css("overflow","auto"); 
 
    $(".content").css("height","auto"); 
 
    }); 
 
});
.card{ 
 
    border: 1px solid black; 
 
    margin: 10px; 
 
    padding: 20px; 
 
} 
 
.content{ 
 
    overflow: hidden; 
 
    height: 40px; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<div class="card"> 
 
    <div class="content"> 
 
    Game of Thrones is an American fantasy drama television series created by David Benioff and D. B. Weiss. It is an adaptation of A Song of Ice and Fire, George R. R. Martin's series of fantasy novels, the first of which is A Game of Thrones. It is filmed in Belfast and elsewhere in the United Kingdom, Canada, Croatia, Iceland, Malta, Morocco, Spain, and the United States. The series premiered on HBO in the United States on April 17, 2011, and its seventh season ended on August 27, 2017. The series will conclude with its eighth season premiering either in 2018 or 2019.[1] 
 

 
Set on the fictional continents of Westeros and Essos, Game of Thrones has several plot lines and a large ensemble cast but centers on three primary story arcs. The first story arc centers on the Iron Throne of the Seven Kingdoms and follows a web of alliances and conflicts among the dynastic noble families either vying to claim the throne or fighting for independence from the throne. The second story arc focuses on the last descendant of the realm's deposed ruling dynasty, exiled and plotting a return to the throne. The third story arc centers on the longstanding brotherhood charged with defending the realm against the ancient threats of the fierce peoples and legendary creatures that lie far north, and an impending winter that threatens the realm.Game of Thrones has attracted record viewership on HBO and has a broad, active, international fan base. It has been acclaimed by critics, particularly for its acting, complex characters, story, scope, and production values, although its frequent use of nudity and violence (including sexual violence) has been criticized. The series has received 38 Primetime Emmy Awards, including Outstanding Drama Series in 2015 and 2016, more than any other primetime scripted television series. Its other awards and nominations include three Hugo Awards for Best Dramatic Presentation (2012–2014), a 2011 Peabody Award, and four nominations for the Golden Globe Award for Best Television Series – Drama (2012 and 2015–2017). Of the ensemble cast, Peter Dinklage has won two Primetime Emmy Awards for Outstanding Supporting Actor in a Drama Series (2011 and 2015) and the Golden Globe Award for Best Supporting Actor – Series, Miniseries or Television Film (2012) for his performance as Tyrion Lannister. Lena Headey, Emilia Clarke, Kit Harington, Maisie Williams, Diana Rigg, and Max von Sydow have also received Primetime Emmy Award nominations for their performances in the series. 
 
    </div> 
 
    <button id="click-me">Read More</button> 
 
</div>
를 첨부 덜 '을'다시 읽으십시오 '.

편집 :

내가 보여 여러 내용이 다음 좀 더 읽기 사이를 전환 덜 읽고 싶은 경우

. 나는 아래 코드를 붙이고 있는데, 'this'객체를 사용하여 현재 객체에 액세스하고 있지만 해당 요소의 내용에만 액세스하는 방법은 사용하지 않습니다. 귀하의 답변

$(document).ready(function(){ 
 
    var readMore=true; 
 
    $(".more-less").on("click", function(){ 
 
    var txt=$(this).html(); 
 
    console.log($(this)); 
 
    if(readMore){ 
 
    $(this).html("Read Less"); 
 
    $('.content').css("overflow","auto"); 
 
    $(this).css("height","auto"); 
 
     readMore=false; 
 
    }else{ 
 
    $(this).html("Read More..."); 
 
    $('.content').css("overflow","hidden"); 
 
    $(this).css("height","40px");  
 
     readMore=true; 
 
    } 
 
    }); 
 
});
.card{ 
 
    border: 1px solid black; 
 
    margin: 10px; 
 
    padding: 20px; 
 
} 
 
.content{ 
 
    overflow: hidden; 
 
    height: 40px; 
 
} 
 
.more-less{ 
 
    text-decoration: none; 
 
    font-weight: bold; 
 
}
<div class="card"> 
 
    <div class="content"> 
 
    Game of Thrones is an American fantasy drama television series created by David Benioff and D. B. Weiss. It is an adaptation of A Song of Ice and Fire, George R. R. Martin's series of fantasy novels, the first of which is A Game of Thrones. It is filmed in Belfast and elsewhere in the United Kingdom, Canada, Croatia, Iceland, Malta, Morocco, Spain, and the United States. The series premiered on HBO in the United States on April 17, 2011, and its seventh season ended on August 27, 2017. The series will conclude with its eighth season premiering either in 2018 or 2019.[1] 
 

 
Set on the fictional continents of Westeros and Essos, Game of Thrones has several plot lines and a large ensemble cast but centers on three primary story arcs. The first story arc centers on the Iron Throne of the Seven Kingdoms and follows a web of alliances and conflicts among the dynastic noble families either vying to claim the throne or fighting for independence from the throne. The second story arc focuses on the last descendant of the realm's deposed ruling dynasty, exiled and plotting a return to the throne. The third story arc centers on the longstanding brotherhood charged with defending the realm against the ancient threats of the fierce peoples and legendary creatures that lie far north, and an impending winter that threatens the realm.Game of Thrones has attracted record viewership on HBO and has a broad, active, international fan base. It has been acclaimed by critics, particularly for its acting, complex characters, story, scope, and production values, although its frequent use of nudity and violence (including sexual violence) has been criticized. The series has received 38 Primetime Emmy Awards, including Outstanding Drama Series in 2015 and 2016, more than any other primetime scripted television series. Its other awards and nominations include three Hugo Awards for Best Dramatic Presentation (2012–2014), a 2011 Peabody Award, and four nominations for the Golden Globe Award for Best Television Series – Drama (2012 and 2015–2017). Of the ensemble cast, Peter Dinklage has won two Primetime Emmy Awards for Outstanding Supporting Actor in a Drama Series (2011 and 2015) and the Golden Globe Award for Best Supporting Actor – Series, Miniseries or Television Film (2012) for his performance as Tyrion Lannister. Lena Headey, Emilia Clarke, Kit Harington, Maisie Williams, Diana Rigg, and Max von Sydow have also received Primetime Emmy Award nominations for their performances in the series. 
 
    </div> 
 
    <a href="#" class="more-less">Read More...</a> 
 
</div> 
 
<div class="card"> 
 
    <div class="content"> 
 
    Game of Thrones is an American fantasy drama television series created by David Benioff and D. B. Weiss. It is an adaptation of A Song of Ice and Fire, George R. R. Martin's series of fantasy novels, the first of which is A Game of Thrones. It is filmed in Belfast and elsewhere in the United Kingdom, Canada, Croatia, Iceland, Malta, Morocco, Spain, and the United States. The series premiered on HBO in the United States on April 17, 2011, and its seventh season ended on August 27, 2017. The series will conclude with its eighth season premiering either in 2018 or 2019.[1] 
 

 
Set on the fictional continents of Westeros and Essos, Game of Thrones has several plot lines and a large ensemble cast but centers on three primary story arcs. The first story arc centers on the Iron Throne of the Seven Kingdoms and follows a web of alliances and conflicts among the dynastic noble families either vying to claim the throne or fighting for independence from the throne. The second story arc focuses on the last descendant of the realm's deposed ruling dynasty, exiled and plotting a return to the throne. The third story arc centers on the longstanding brotherhood charged with defending the realm against the ancient threats of the fierce peoples and legendary creatures that lie far north, and an impending winter that threatens the realm.Game of Thrones has attracted record viewership on HBO and has a broad, active, international fan base. It has been acclaimed by critics, particularly for its acting, complex characters, story, scope, and production values, although its frequent use of nudity and violence (including sexual violence) has been criticized. The series has received 38 Primetime Emmy Awards, including Outstanding Drama Series in 2015 and 2016, more than any other primetime scripted television series. Its other awards and nominations include three Hugo Awards for Best Dramatic Presentation (2012–2014), a 2011 Peabody Award, and four nominations for the Golden Globe Award for Best Television Series – Drama (2012 and 2015–2017). Of the ensemble cast, Peter Dinklage has won two Primetime Emmy Awards for Outstanding Supporting Actor in a Drama Series (2011 and 2015) and the Golden Globe Award for Best Supporting Actor – Series, Miniseries or Television Film (2012) for his performance as Tyrion Lannister. Lena Headey, Emilia Clarke, Kit Harington, Maisie Williams, Diana Rigg, and Max von Sydow have also received Primetime Emmy Award nominations for their performances in the series. 
 
    </div> 
 
    <a href="#" class="more-less">Read More...</a> 
 
</div>

감사합니다.

답변

0

$(document).ready(function(){ 
 
    var readMore=true; 
 
    $(".more-less").on("click", function(){ 
 
    var txt=$(this).html(); 
 
    console.log($(this)); 
 
    if(readMore){ 
 
    $(this).html("Read Less"); 
 
    $(this).parent().find('.content').css("overflow","auto"); 
 
    $(this).css("height","auto"); 
 
     readMore=false; 
 
    }else{ 
 
    $(this).html("Read More..."); 
 
    $(this).parent().find('.content').css("overflow","hidden"); 
 
    $(this).css("height","40px");  
 
     readMore=true; 
 
    } 
 
    }); 
 
});
.card{ 
 
    border: 1px solid black; 
 
    margin: 10px; 
 
    padding: 20px; 
 
} 
 
.content{ 
 
    overflow: hidden; 
 
    height: 40px; 
 
} 
 
.more-less{ 
 
    text-decoration: none; 
 
    font-weight: bold; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<div class="card"> 
 
    <div class="content"> 
 
    Game of Thrones is an American fantasy drama television series created by David Benioff and D. B. Weiss. It is an adaptation of A Song of Ice and Fire, George R. R. Martin's series of fantasy novels, the first of which is A Game of Thrones. It is filmed in Belfast and elsewhere in the United Kingdom, Canada, Croatia, Iceland, Malta, Morocco, Spain, and the United States. The series premiered on HBO in the United States on April 17, 2011, and its seventh season ended on August 27, 2017. The series will conclude with its eighth season premiering either in 2018 or 2019.[1] 
 

 
Set on the fictional continents of Westeros and Essos, Game of Thrones has several plot lines and a large ensemble cast but centers on three primary story arcs. The first story arc centers on the Iron Throne of the Seven Kingdoms and follows a web of alliances and conflicts among the dynastic noble families either vying to claim the throne or fighting for independence from the throne. The second story arc focuses on the last descendant of the realm's deposed ruling dynasty, exiled and plotting a return to the throne. The third story arc centers on the longstanding brotherhood charged with defending the realm against the ancient threats of the fierce peoples and legendary creatures that lie far north, and an impending winter that threatens the realm.Game of Thrones has attracted record viewership on HBO and has a broad, active, international fan base. It has been acclaimed by critics, particularly for its acting, complex characters, story, scope, and production values, although its frequent use of nudity and violence (including sexual violence) has been criticized. The series has received 38 Primetime Emmy Awards, including Outstanding Drama Series in 2015 and 2016, more than any other primetime scripted television series. Its other awards and nominations include three Hugo Awards for Best Dramatic Presentation (2012–2014), a 2011 Peabody Award, and four nominations for the Golden Globe Award for Best Television Series – Drama (2012 and 2015–2017). Of the ensemble cast, Peter Dinklage has won two Primetime Emmy Awards for Outstanding Supporting Actor in a Drama Series (2011 and 2015) and the Golden Globe Award for Best Supporting Actor – Series, Miniseries or Television Film (2012) for his performance as Tyrion Lannister. Lena Headey, Emilia Clarke, Kit Harington, Maisie Williams, Diana Rigg, and Max von Sydow have also received Primetime Emmy Award nominations for their performances in the series. 
 
    </div> 
 
    <a href="#" class="more-less">Read More...</a> 
 
</div> 
 
<div class="card"> 
 
    <div class="content"> 
 
    Game of Thrones is an American fantasy drama television series created by David Benioff and D. B. Weiss. It is an adaptation of A Song of Ice and Fire, George R. R. Martin's series of fantasy novels, the first of which is A Game of Thrones. It is filmed in Belfast and elsewhere in the United Kingdom, Canada, Croatia, Iceland, Malta, Morocco, Spain, and the United States. The series premiered on HBO in the United States on April 17, 2011, and its seventh season ended on August 27, 2017. The series will conclude with its eighth season premiering either in 2018 or 2019.[1] 
 

 
Set on the fictional continents of Westeros and Essos, Game of Thrones has several plot lines and a large ensemble cast but centers on three primary story arcs. The first story arc centers on the Iron Throne of the Seven Kingdoms and follows a web of alliances and conflicts among the dynastic noble families either vying to claim the throne or fighting for independence from the throne. The second story arc focuses on the last descendant of the realm's deposed ruling dynasty, exiled and plotting a return to the throne. The third story arc centers on the longstanding brotherhood charged with defending the realm against the ancient threats of the fierce peoples and legendary creatures that lie far north, and an impending winter that threatens the realm.Game of Thrones has attracted record viewership on HBO and has a broad, active, international fan base. It has been acclaimed by critics, particularly for its acting, complex characters, story, scope, and production values, although its frequent use of nudity and violence (including sexual violence) has been criticized. The series has received 38 Primetime Emmy Awards, including Outstanding Drama Series in 2015 and 2016, more than any other primetime scripted television series. Its other awards and nominations include three Hugo Awards for Best Dramatic Presentation (2012–2014), a 2011 Peabody Award, and four nominations for the Golden Globe Award for Best Television Series – Drama (2012 and 2015–2017). Of the ensemble cast, Peter Dinklage has won two Primetime Emmy Awards for Outstanding Supporting Actor in a Drama Series (2011 and 2015) and the Golden Globe Award for Best Supporting Actor – Series, Miniseries or Television Film (2012) for his performance as Tyrion Lannister. Lena Headey, Emilia Clarke, Kit Harington, Maisie Williams, Diana Rigg, and Max von Sydow have also received Primetime Emmy Award nominations for their performances in the series. 
 
    </div> 
 
    <a href="#" class="more-less">Read More...</a> 
 
</div>

+0

이봐! 수정 된 질문에 대한 답변을 제공해 주시겠습니까? –

+1

@RajMalhotra 대답 수정 됨 응답을 승인하십시오 –

+0

농담하고 있습니까? 그것은 작동하지 않습니다 :) – Styx

1

현재 텍스트가 무엇인지 확인하고 다른 작업을 수행 할 수 있습니다.

$(document).ready(function(){ 
    $("#click-me").on("click", function(){ 
    if ($(this).html() === "Read More") { 
     // Change to Read Less 
    } else { 
     // Change to Read More 
    } 

    }); 
}); 
0

당신은 같은 이벤트와 다른도 Clicker이 속성 data-* HTML5 사용할 수 있습니다 : 당신은 열 수 다른 div를 연결할 수 있습니다

$("#click-me").on("click", function(){ 
    if ($(this).attr("data-shouldOpen") != "false") { 
     $(this).attr("data-shouldOpen", "false"); 
     open(); // opening code here 
    } else { 
     $(this).attr("data-shouldOpen", "true"); 
     close(); // closing code here 
    } 
}); 

를 /에 의해 폐쇄 자신의 버튼.

2

클래스를 사용하여 상태를 제어하는 ​​대리자를 사용했습니다.

$(document).ready(function(){ 
 
    $('#read-options') 
 
    .on('click', "#click-me.expanded", function(){ 
 
     $(this).html("Read More").removeClass('expanded'); 
 
     $(".content").css("overflow",""); 
 
     $(".content").css("height",""); 
 
    }).on('click', "#click-me:not(.expanded)", function(){ 
 
     $(this).html("Read Less").addClass('expanded'); 
 
     $(".content").css("overflow","auto"); 
 
     $(".content").css("height","auto"); 
 
    }); 
 
});
.card{ 
 
    border: 1px solid black; 
 
    margin: 10px; 
 
    padding: 20px; 
 
} 
 
.content{ 
 
    overflow: hidden; 
 
    height: 40px; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<div class="card"> 
 
    <div class="content"> 
 
    Game of Thrones is an American fantasy drama television series created by David Benioff and D. B. Weiss. It is an adaptation of A Song of Ice and Fire, George R. R. Martin's series of fantasy novels, the first of which is A Game of Thrones. It is filmed in Belfast and elsewhere in the United Kingdom, Canada, Croatia, Iceland, Malta, Morocco, Spain, and the United States. The series premiered on HBO in the United States on April 17, 2011, and its seventh season ended on August 27, 2017. The series will conclude with its eighth season premiering either in 2018 or 2019.[1] 
 

 
Set on the fictional continents of Westeros and Essos, Game of Thrones has several plot lines and a large ensemble cast but centers on three primary story arcs. The first story arc centers on the Iron Throne of the Seven Kingdoms and follows a web of alliances and conflicts among the dynastic noble families either vying to claim the throne or fighting for independence from the throne. The second story arc focuses on the last descendant of the realm's deposed ruling dynasty, exiled and plotting a return to the throne. The third story arc centers on the longstanding brotherhood charged with defending the realm against the ancient threats of the fierce peoples and legendary creatures that lie far north, and an impending winter that threatens the realm.Game of Thrones has attracted record viewership on HBO and has a broad, active, international fan base. It has been acclaimed by critics, particularly for its acting, complex characters, story, scope, and production values, although its frequent use of nudity and violence (including sexual violence) has been criticized. The series has received 38 Primetime Emmy Awards, including Outstanding Drama Series in 2015 and 2016, more than any other primetime scripted television series. Its other awards and nominations include three Hugo Awards for Best Dramatic Presentation (2012–2014), a 2011 Peabody Award, and four nominations for the Golden Globe Award for Best Television Series – Drama (2012 and 2015–2017). Of the ensemble cast, Peter Dinklage has won two Primetime Emmy Awards for Outstanding Supporting Actor in a Drama Series (2011 and 2015) and the Golden Globe Award for Best Supporting Actor – Series, Miniseries or Television Film (2012) for his performance as Tyrion Lannister. Lena Headey, Emilia Clarke, Kit Harington, Maisie Williams, Diana Rigg, and Max von Sydow have also received Primetime Emmy Award nominations for their performances in the series. 
 
    </div> 
 
    <span id="read-options"> 
 
    <button id="click-me">Read More</button> 
 
    </span> 
 
</div>

+0

'click' 이벤트의 멋진 사용! –

+0

?? 왜'$ ('click-me')'대신'$ (this) .html ("Less Less")'를 사용 했습니까? –

+0

'this'는 click-me입니다. 위임자의 자식 선택기 필터입니다. 그리고 그것은 질문에서 사본 붙여 넣기였습니다 :) – Taplar

2

대답은 추가 질문에 대답하도록 업데이트되었습니다.

가장 쉬운 방법은 추가 CSS 클래스를 만들고 클릭하여 토글하는 것입니다. 여러 개의 버튼에서 작동하도록하려면 HTML을 업데이트해야합니다. 코드는 버튼의 id 속성에 의존하지 않습니다 :

$(document).ready(function(){ 
 
    $(".toggle-more").on("click", function(){ 
 
    $(this).closest(".card").toggleClass("show-more"); 
 
    }); 
 
});
.card { 
 
    border: 1px solid black; 
 
    margin: 10px; 
 
    padding: 20px; 
 
} 
 
.card .content { 
 
    overflow: hidden; 
 
    height: 40px; 
 
} 
 
.card.show-more .content { 
 
    overflow: auto; 
 
    height: auto; 
 
} 
 
.card .toggle-more:before { 
 
    content: "Read More"; 
 
} 
 
.card.show-more .toggle-more:before { 
 
    content: "Read Less"; 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<div class="card"> 
 
    <div class="content"> 
 
    Game of Thrones is an American fantasy drama television series created by David Benioff and D. B. Weiss. It is an adaptation of A Song of Ice and Fire, George R. R. Martin's series of fantasy novels, the first of which is A Game of Thrones. It is filmed in Belfast and elsewhere in the United Kingdom, Canada, Croatia, Iceland, Malta, Morocco, Spain, and the United States. The series premiered on HBO in the United States on April 17, 2011, and its seventh season ended on August 27, 2017. The series will conclude with its eighth season premiering either in 2018 or 2019.[1] 
 
    Set on the fictional continents of Westeros and Essos, Game of Thrones has several plot lines and a large ensemble cast but centers on three primary story arcs. The first story arc centers on the Iron Throne of the Seven Kingdoms and follows a web of alliances and conflicts among the dynastic noble families either vying to claim the throne or fighting for independence from the throne. The second story arc focuses on the last descendant of the realm's deposed ruling dynasty, exiled and plotting a return to the throne. The third story arc centers on the longstanding brotherhood charged with defending the realm against the ancient threats of the fierce peoples and legendary creatures that lie far north, and an impending winter that threatens the realm.Game of Thrones has attracted record viewership on HBO and has a broad, active, international fan base. It has been acclaimed by critics, particularly for its acting, complex characters, story, scope, and production values, although its frequent use of nudity and violence (including sexual violence) has been criticized. The series has received 38 Primetime Emmy Awards, including Outstanding Drama Series in 2015 and 2016, more than any other primetime scripted television series. Its other awards and nominations include three Hugo Awards for Best Dramatic Presentation (2012–2014), a 2011 Peabody Award, and four nominations for the Golden Globe Award for Best Television Series – Drama (2012 and 2015–2017). Of the ensemble cast, Peter Dinklage has won two Primetime Emmy Awards for Outstanding Supporting Actor in a Drama Series (2011 and 2015) and the Golden Globe Award for Best Supporting Actor – Series, Miniseries or Television Film (2012) for his performance as Tyrion Lannister. Lena Headey, Emilia Clarke, Kit Harington, Maisie Williams, Diana Rigg, and Max von Sydow have also received Primetime Emmy Award nominations for their performances in the series. 
 
    </div> 
 
    <button class="toggle-more"></button> 
 
</div> 
 
<div class="card"> 
 
    <div class="content"> 
 
    Game of Thrones is an American fantasy drama television series created by David Benioff and D. B. Weiss. It is an adaptation of A Song of Ice and Fire, George R. R. Martin's series of fantasy novels, the first of which is A Game of Thrones. It is filmed in Belfast and elsewhere in the United Kingdom, Canada, Croatia, Iceland, Malta, Morocco, Spain, and the United States. The series premiered on HBO in the United States on April 17, 2011, and its seventh season ended on August 27, 2017. The series will conclude with its eighth season premiering either in 2018 or 2019.[1] 
 
    Set on the fictional continents of Westeros and Essos, Game of Thrones has several plot lines and a large ensemble cast but centers on three primary story arcs. The first story arc centers on the Iron Throne of the Seven Kingdoms and follows a web of alliances and conflicts among the dynastic noble families either vying to claim the throne or fighting for independence from the throne. The second story arc focuses on the last descendant of the realm's deposed ruling dynasty, exiled and plotting a return to the throne. The third story arc centers on the longstanding brotherhood charged with defending the realm against the ancient threats of the fierce peoples and legendary creatures that lie far north, and an impending winter that threatens the realm.Game of Thrones has attracted record viewership on HBO and has a broad, active, international fan base. It has been acclaimed by critics, particularly for its acting, complex characters, story, scope, and production values, although its frequent use of nudity and violence (including sexual violence) has been criticized. The series has received 38 Primetime Emmy Awards, including Outstanding Drama Series in 2015 and 2016, more than any other primetime scripted television series. Its other awards and nominations include three Hugo Awards for Best Dramatic Presentation (2012–2014), a 2011 Peabody Award, and four nominations for the Golden Globe Award for Best Television Series – Drama (2012 and 2015–2017). Of the ensemble cast, Peter Dinklage has won two Primetime Emmy Awards for Outstanding Supporting Actor in a Drama Series (2011 and 2015) and the Golden Globe Award for Best Supporting Actor – Series, Miniseries or Television Film (2012) for his performance as Tyrion Lannister. Lena Headey, Emilia Clarke, Kit Harington, Maisie Williams, Diana Rigg, and Max von Sydow have also received Primetime Emmy Award nominations for their performances in the series. 
 
    </div> 
 
    <button class="toggle-more"></button> 
 
</div>

+0

안녕하세요! 수정 된 질문에 대한 답변을 제공해 주시겠습니까? –

+1

@RajMalhotra 예,하지만 앞으로는 같은 질문에서 더 많은 질문을하는 대신 새로운 질문을하는 것이 좋습니다. – Styx

+0

물론, 다음 번에 그 점을 염두에 두십시오 –

0
$(document).ready(function(){ 
    $("#click-me").on("click", function(){ 
    $(this).toggleClass('readLess'); 
    $(".content").toggleClass('hidden'); 
    if($(this).hasClass('readLess')){ 
     $(this).text("Read Less"); 
    }else{ 
     $(this).text("Read More"); 
    } 
    }); 
}); 

.hidden { 
    overflow: auto; 
    height: auto; 
} // add this to your styles