site.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. function map() {
  2. var $carte = $('#carte');
  3. if ( $carte.length ) {
  4. var mymap = L.map('carte').setView([44.7365818, 4.9776488], 13);
  5. var greenIcon = L.icon({
  6. iconUrl: '/user/themes/lecampus/images/mappoint.svg',
  7. iconSize: [38, 95], // size of the icon
  8. iconAnchor: [22, 94], // point of the icon which will correspond to marker's location
  9. popupAnchor: [-3, -76] // point from which the popup should open relative to the iconAnchor
  10. });
  11. L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
  12. maxZoom: 18,
  13. id: 'mapbox.streets'
  14. }).addTo(mymap);
  15. L.marker([44.7365818, 4.9776488], {icon: greenIcon}).addTo(mymap)
  16. .bindPopup("<b>Hello world!</b><br />I am le campus.").openPopup();
  17. function onMapClick(e) {
  18. popup
  19. .setLatLng(e.latlng)
  20. .setContent("You clicked the map at " + e.latlng.toString())
  21. .openOn(mymap);
  22. }
  23. mymap.on('click', onMapClick);
  24. }
  25. }
  26. function filteritem() {
  27. var $card = $('.body-wrapper > .card');
  28. var $cat = $('.cat a');
  29. var $img = $('.body-wrapper .img');
  30. $(".filters .btn").click(function(e) {
  31. e.preventDefault();
  32. var filter = $(this).attr("data-filter");
  33. var self = $('.body-wrapper');
  34. self.masonryFilter({
  35. filter: function () {
  36. if (!filter) return true;
  37. return $(this).attr("data-filter") == filter;
  38. }
  39. });
  40. });
  41. var $grid = $('#archive .body-wrapper, #calendrier .body-wrapper').masonry({
  42. // columnWidth: 200,
  43. itemSelector: '.card',
  44. gutter: 10,
  45. transitionDuration: '0.2s'
  46. });
  47. // $( "a[hreflang|='en']" ).css( "border", "3px dotted green" );
  48. $grid.imagesLoaded().progress(function() {
  49. $grid.masonry();
  50. });
  51. }
  52. function slide() {
  53. $('.gal').bxSlider({
  54. responsive: true,
  55. infiniteLoop: true,
  56. preloadImages:'visible',
  57. pager:false,
  58. auto:true,
  59. });
  60. }
  61. function links() {
  62. var $a = $('li a[href="/organisez-vos-evenements"],li a[href="/qui-sommes-nous"] ');
  63. var $map = $('a#carte');
  64. $a.on('click', function(e) {
  65. e.preventDefault();
  66. })
  67. $map.on('click', function(e) {
  68. e.preventDefault();
  69. })
  70. }
  71. function clickbutton() {
  72. var $button = $('#ajax-test-form .radio');
  73. $button.on('click', function(){
  74. $(this).parent('.form-data').find('.check').removeClass('check');
  75. $(this).addClass('check');
  76. });
  77. }
  78. function clicksenddevis() {
  79. var $ok = $('.ok');
  80. var $send = $('#send-valide');
  81. $ok.on('click', function () {
  82. $(this).parent('#send-valide').remove();
  83. })
  84. }
  85. function addclass() {
  86. var $map = $('a#carte');
  87. $map.parents('.content_s').addClass('map')
  88. var $reco_click = $('#reco .title');
  89. var $reco_txt = $('#reco .txt');
  90. $reco_click.on('click', function() {
  91. $reco_txt.toggleClass('open');
  92. $(this).toggleClass('open');
  93. })
  94. }
  95. jQuery(document).ready(function(){
  96. addclass();
  97. clickbutton();
  98. links();
  99. slide();
  100. filteritem();
  101. map();
  102. });