98 lines
2.0 KiB
JavaScript
98 lines
2.0 KiB
JavaScript
/**
|
|
* @file
|
|
* quartiers_de_demain behaviors.
|
|
*/
|
|
(function (Drupal) {
|
|
|
|
'use strict';
|
|
|
|
Drupal.behaviors.quartiers_de_demain = {
|
|
attach: function (context, settings) {
|
|
|
|
console.log('It works!');
|
|
|
|
}
|
|
};
|
|
|
|
|
|
} (Drupal));
|
|
|
|
|
|
jQuery(document).ready(function($){
|
|
|
|
|
|
$('.open-block').click(function(){
|
|
$(this).toggleClass('opened');
|
|
|
|
$('.header_nav_container').toggleClass('display-nav-opened');
|
|
|
|
if(mobile == true){
|
|
$("body").css("overflow","hidden");
|
|
}
|
|
|
|
});
|
|
|
|
// Hide the header_nav_container when a link inside it is clicked
|
|
$('.header_nav_container li').click(function() {
|
|
$('.header_nav_container').fadeOut();
|
|
});
|
|
|
|
|
|
|
|
// // /////////////////
|
|
// //// ancre dans texte au click parragraphe correspondant arrive en dessous du header
|
|
|
|
|
|
(function($, window) {
|
|
var adjustAnchor = function() {
|
|
var $anchor = $('.sidebar_first_container'),
|
|
fixedElementHeight = 350;
|
|
if ($anchor.length > 0) {
|
|
$('html, body').stop().animate({scrollTop: $anchor.offset().top - fixedElementHeight }, 0);
|
|
}
|
|
};
|
|
|
|
$(window).on('hashchange', function() {
|
|
adjustAnchor();
|
|
});
|
|
|
|
})(jQuery, window);
|
|
|
|
|
|
|
|
//////////// agrandissement du shema
|
|
|
|
$('#paragraph-id--9 img').click(function() {
|
|
$(this).toggleClass('zoom_in');
|
|
});
|
|
|
|
|
|
});
|
|
|
|
// function $(id){
|
|
// return document.getElementById(id);
|
|
// }
|
|
|
|
// function agrandir(id){
|
|
// $('popup').style.display='block';
|
|
// $('imageAgrandie').src=$(id).src;
|
|
// }
|
|
|
|
// function reduire(){
|
|
// $('popup').style.display='none';
|
|
// $('imageAgrandie').src="";
|
|
// }
|
|
|
|
|
|
// zoom=2;
|
|
// document.body.onmousemouve=function(){
|
|
// loupe=document.getElementById("#paragraph-id--9");
|
|
// loupe.style.left=event.clientX+"px";
|
|
// loupe.style.right=event.clientY+"px";
|
|
// loupe.style.backgroundSize=(1500*zoom)+"px";
|
|
// loupe.style.backgroundPosition=(-loupe.offsetLeft+zoom-150)+"px"+(-loupe.offsetTop+zoom-150)+"px";
|
|
// }
|
|
|
|
function $zoom() {
|
|
|
|
} |