Guest User

Untitled

a guest
Jan 18th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. ---
  2. title: "Sliding Divs"
  3. output:
  4. html_document:
  5. self_contained: true
  6. ---
  7.  
  8. <!-- a little CSS -->
  9. <style>
  10. .slidingDiv {
  11. height:800px;
  12. width:100%
  13. background-color: #FFFFFF;
  14. padding:10px;
  15. margin-top:10px;
  16. border-bottom:5px solid #FFFFFF;
  17. }
  18.  
  19. .show_hide {
  20. display:none;
  21. }
  22. </style>
  23.  
  24. <!-- a little jQuery -->
  25. <script>
  26. $(document).ready(function(){
  27.  
  28. $(".slidingDiv").hide();
  29. $(".show_hide").show();
  30.  
  31. $('.show_hide').click(function(){
  32. $(".slidingDiv").slideToggle();
  33. });
  34.  
  35. });
  36.  
  37. $table.width('auto');
  38.  
  39. </script>
  40.  
  41. <!-- Start the document -->
  42.  
  43. ```{r datainput}
  44. library(ggplot2)
  45. library(DT)
  46. data(iris)
  47. ```
  48.  
  49. ## Here's a section header
  50.  
  51. Some text
  52.  
  53. #### <a href="###" class="show_hide">Click to show or hide data table</a>
  54.  
  55. <div class="slidingDiv">
  56.  
  57. ```{r a.table}
  58. datatable(iris)
  59. ```
  60.  
  61. </div>
  62.  
  63. ### Another section
  64.  
  65. ```{r a.plot}
  66. qplot(Sepal.Width, Sepal.Length,
  67. color = Species,
  68. data = iris)
  69. ```
Add Comment
Please, Sign In to add comment