Guest User

Untitled

a guest
Jun 22nd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. <script src="jquery/jquery-3.2.1.js"></script>
  2.  
  3. <script>
  4.  
  5. $("#gallerytrigger_1").on('click',function(){
  6. $("#gallery_1").toggle();
  7. $("#gallery_2").hide();
  8. $("#gallery_3").hide();
  9. $("#gallery_4").hide();
  10. });
  11.  
  12. $("#gallerytrigger_2").on('click',function(){
  13. $("#gallery_4").hide();
  14. $("#gallery_3").hide();
  15. $("#gallery_2").toggle();
  16. $("#gallery_1").hide();
  17. });
  18.  
  19. $("#gallerytrigger_3").on('click',function(){
  20. $("#gallery_4").hide();
  21. $("#gallery_3").toggle();
  22. $("#gallery_2").hide();
  23. $("#gallery_1").hide();
  24. });
  25.  
  26. $("#gallerytrigger_4").on('click',function(){
  27. $("#gallery_4").toggle();
  28. $("#gallery_3").hide();
  29. $("#gallery_2").hide();
  30. $("#gallery_1").hide();
  31. });
  32. </script
  33.  
  34. @foreach($gallerys as $gallery)
  35. <div class="col-sm-2">
  36. <br>
  37. <div id="gallery_{{$loop->iteration}}" style="display:none;">
  38. <p style="text-align: center;"><img style="width: 100%;border-radius:
  39. 6px;" src="/gallery/{{ $gallery->imagelocation }}"></p>
  40. </div>
  41. </div>
  42. @endforeach
  43.  
  44. @foreach($gallerys as $gallery)
  45. <div class="col-xs-2">
  46. <br>
  47. <div id="gallerytrigger_{{$loop->iteration}}">
  48. <hr>
  49. <img style="width: 200%;border-radius: 6px;margin-left: -12px;margin-
  50. top: -100px;" src="/gallery/{{ $gallery->imagelocation }}">
  51. </div>
  52. </div>
  53. @endforeach
  54.  
  55. <script src="jquery/jquery-3.2.1.js"></script>
  56.  
  57. <script>
  58. $(".galleryTrigger").click(function(){
  59. var id = $(this).data('id');
  60. $(".gallery").hide();
  61. $("#gallery_"+id).show();
  62. });
  63. </script>
  64.  
  65. @foreach($gallerys as $gallery)
  66. <div class="col-sm-2">
  67. <br>
  68. <div id="gallery_{{$loop->iteration}}" style="display:none;" class="gallery" data-id="{{$loop->iteration}}">
  69. <p style="text-align: center;"><img style="width: 100%;border-radius:
  70. 6px;" src="/gallery/{{ $gallery->imagelocation }}"></p>
  71. </div>
  72. </div>
  73. @endforeach
  74.  
  75. @foreach($gallerys as $gallery)
  76. <div class="col-xs-2">
  77. <br>
  78. <div id="gallerytrigger_{{$loop->iteration}}" data-id="{{$loop->iteration}}" class="galleryTrigger">
  79. <hr>
  80. <img style="width: 200%;border-radius: 6px;margin-left: -12px;margin-
  81. top: -100px;" src="/gallery/{{ $gallery->imagelocation }}">
  82. </div>
  83. </div>
  84. @endforeach
Add Comment
Please, Sign In to add comment