Advertisement
NaotoShirgone

Play Codes

May 5th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1.  
  2.  
  3. /* Slide Image Toggle */
  4.  
  5. .divvs {
  6. background: #000;
  7. width: 2em;
  8. height: 2em;
  9.  
  10. float: left;
  11. margin: 0 1em;
  12. }
  13.  
  14. #pg1, #pg2, #pg3, #pg4 {
  15. /* display: none; */
  16. }
  17.  
  18. label {
  19. display: inline-block;
  20. }
  21.  
  22. #pg1:checked ~ #loc1 {
  23. /* Checked means if they've been clicked on or selected. */
  24. transform: translate(20em, 0em);
  25. opacity: 1;
  26. }
  27.  
  28. #pg2:checked ~ #loc2 {
  29. transform: translate(20em, 0em);
  30. opacity: 1;
  31. }
  32.  
  33. #pg3:checked ~ #loc3 {
  34. transform: translate(20em, 0em);
  35. opacity: 1;
  36. }
  37.  
  38. #pg4:checked ~ #loc4 {
  39. transform: translate(20em, 0em);
  40. opacity: 1;
  41. }
  42.  
  43. .divcont {
  44. width: 10em;
  45. height: 10em;
  46.  
  47. position: absolute;
  48.  
  49. -webkit-transition-duration: 0.8s;
  50. -moz-transition-duration: 0.8s;
  51. -ms-transition-duration: 0.8s;
  52. -o-transition-duration: 0.8s;
  53. transition-duration: 0.8s;
  54. }
  55.  
  56. </style>
  57.  
  58. <!-- Buttons are always placed right after style tag. They don't work otherwise. Don't know why yet. -->
  59.  
  60. <input type="radio" name="col" id="pg1">
  61. <input type="radio" name="col" id="pg2">
  62. <input type="radio" name="col" id="pg3">
  63. <input type="radio" name="col" id="pg4">
  64.  
  65. <!-- Labels can be clicked instead of radio buttons since they share IDs. With this, you can hide the radio buttons in CSS with a simple "display: none;" -->
  66.  
  67. <label for="pg1">
  68. <div class="divvs">
  69. </div>
  70. </label>
  71.  
  72. <label for="pg2">
  73. <div class="divvs">
  74. </div>
  75. </label>
  76.  
  77. <label for="pg3">
  78. <div class="divvs">
  79. </div>
  80. </label>
  81.  
  82. <label for="pg4">
  83. <div class="divvs">
  84. </div>
  85. </label>
  86.  
  87. <div id="loc1" class="divcont up1" style="background-color: red;">one div</div>
  88. <div id="loc2" class="divcont up1" style="background-color: green;">two div</div>
  89. <div id="loc3" class="divcont up1" style="background-color: purple;">three div</div>
  90. <div id="loc4" class="divcont up1" style="background-color: pink;">four div</div>
  91.  
  92. <!-- Labels can be placed within divs -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement