Advertisement
Guest User

Untitled

a guest
Apr 8th, 2015
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. @if(Model.comments != null)
  2. {
  3. int i = 0;
  4. foreach(var item in Model.comments)
  5. {
  6. if(i<10)
  7. {
  8. <div class="prvMsgs">@MvcHtmlString.Create(item.text)</div>
  9. }
  10. else
  11. {
  12. <div class="prvMsgs rest">@MvcHtmlString.Create(item.text)</div>
  13. }
  14. ++i;
  15. }
  16. }
  17. <div id="showAllComments">Pokaż wszystkie</div>
  18.  
  19. <script>
  20. $(document).ready(function () {
  21. $('.rest').hide()
  22. });
  23.  
  24. $('#showAllComments').click(function () {
  25. $('.rest').show()
  26. })
  27. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement