Commit 4ac0e8a6 authored by imac's avatar imac

[Update]Fixed menu

parent a174e96c
...@@ -810,6 +810,9 @@ nav ul ul{ ...@@ -810,6 +810,9 @@ nav ul ul{
display: none; display: none;
width: 190px; width: 190px;
} }
.header .nav-wrapper ul li.current ul{
display: block;
}
/*nav ul ul li:before{ /*nav ul ul li:before{
content: "•"; content: "•";
padding-right: 5px; padding-right: 5px;
...@@ -2682,7 +2685,7 @@ div.wpcf7-mail-sent-ok{ ...@@ -2682,7 +2685,7 @@ div.wpcf7-mail-sent-ok{
top: 0;left:0;right: 0; top: 0;left:0;right: 0;
/*margin:0 -4px -5px -2px;*/ /*margin:0 -4px -5px -2px;*/
transition: all .2s ease; transition: all .2s ease;
z-index: 9999999999999999; z-index: 999999;
} }
#loading-container-subpage{ #loading-container-subpage{
display: none; display: none;
......
...@@ -72,13 +72,13 @@ var initFunction=function(){ ...@@ -72,13 +72,13 @@ var initFunction=function(){
elemToScroll = $(document).find(".main"); elemToScroll = $(document).find(".main");
scrollAnchor('body', true); scrollAnchor('body', true);
} }
elemToScroll.on("scroll",{ items: "ul.phototheque li .subcat a"},onScroll); elemToScroll.on("scroll",onScroll);
document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false); document.getElementById('load-page').addEventListener('scroll', window.scrollAnimation.throttledEvent, false);
$(document).find('ul.phototheque').on('click',' li.parent-cat>a',function(e){ $(document).find('ul.main-list-nav').on('click',' li.parent-cat>a',function(e){
var windowWidth = $(window).width(); var windowWidth = $(window).width();
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
$('.phototheque>li').removeClass('current'); $('.main-list-nav>li').removeClass('current');
$(this).parent().addClass('current'); $(this).parent().addClass('current');
//if (windowWidth < 860){ //if (windowWidth < 860){
//$('.nav-phototeque .nav-content>ul>li').addClass('animated fadeOutLeft'); //$('.nav-phototeque .nav-content>ul>li').addClass('animated fadeOutLeft');
...@@ -87,9 +87,9 @@ var initFunction=function(){ ...@@ -87,9 +87,9 @@ var initFunction=function(){
//$('.nav-phototeque .nav-content li.current ul').css('display','inline-block !important'); //$('.nav-phototeque .nav-content li.current ul').css('display','inline-block !important');
//.phototheque-content nav li //.phototheque-content nav li
//}else{ //}else{
$('.phototheque .subcat').slideUp('slow'); $('.main-list-nav .subcat').stop().slideUp('slow');
$('.phototheque .off .subcat').slideUp(); // $('.main-list-nav .off .subcat').slideUp();
$(this).parent().find('.subcat').slideDown('slow'); $(this).parent().find('.subcat').stop().slideDown('slow');
//} //}
...@@ -97,7 +97,7 @@ var initFunction=function(){ ...@@ -97,7 +97,7 @@ var initFunction=function(){
setTimeout(function(){ setTimeout(function(){
$('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp'); $('.gallery-wrapper').removeClass('hidden-elem').addClass('animated visible-elem fadeInUp');
$.fn.responsive(); $.fn.responsive();
},50) },100);
} }
function appendLoading() { function appendLoading() {
$('.load-page').append($('#loading-container-subpage').clone()); $('.load-page').append($('#loading-container-subpage').clone());
...@@ -110,11 +110,30 @@ var initFunction=function(){ ...@@ -110,11 +110,30 @@ var initFunction=function(){
e.preventDefault(); e.preventDefault();
var link = $(this).attr("href"), var link = $(this).attr("href"),
windowWidth = $(window).width(); windowWidth = $(window).width();
if ($(this).parent().parent().hasClass('nav-page')){
$(document).find('.right-container').first().remove();
$('.load-page').parent().css({
'left':$('.nav-wrapper').outerWidth()
});
$('.load-page').css('opacity',1);
$(document).find('#loading-container-subpage').css({
'left': $('.nav-wrapper').outerWidth(),
'width': 'calc(100% - ' + $('.nav-wrapper').outerWidth()+'px)',
})
/**/
$('nav ul li').removeClass('current').addClass('off');
$(this).parent().addClass('current');
$(window)
/**/
}else{
$('.load-page').parent().css({
'left':0,
});
$('.load-page').parent().addClass('active'); $('.load-page').parent().addClass('active');
}
history.pushState(null, null, link); history.pushState(null, null, link);
$('.load-page').load(link,function(){ $('.load-page').load(link,{'ajax' : 1},function(){
$.fn.loadPageContent(); $.fn.loadPageContent();
$('#loading-container-subpage').hide();
}); });
if (windowWidth < 860){ if (windowWidth < 860){
$( ".c-hamburger" ).trigger( "click" ); $( ".c-hamburger" ).trigger( "click" );
...@@ -161,6 +180,7 @@ $('#file-p').on('change',function(e){ ...@@ -161,6 +180,7 @@ $('#file-p').on('change',function(e){
$(document).on('click','.int-link',function(e){ $(document).on('click','.int-link',function(e){
e.preventDefault(); e.preventDefault();
$('.load-page').parent().removeClass('active'); $('.load-page').parent().removeClass('active');
$('.load-page').parent().css('left','100%');
history.pushState(null, null, $(this).find('a').attr('href')); history.pushState(null, null, $(this).find('a').attr('href'));
$('html').css('overflow','auto'); $('html').css('overflow','auto');
tlProduct.reverse(); tlProduct.reverse();
...@@ -634,6 +654,7 @@ function scrollAnchor(elemId, skipZero){ ...@@ -634,6 +654,7 @@ function scrollAnchor(elemId, skipZero){
$('.subcat').each(function(){ $('.subcat').each(function(){
$(this).find('a[href^="#"]').on('click', function (e) { $(this).find('a[href^="#"]').on('click', function (e) {
e.preventDefault(); e.preventDefault();
e.stopPropagation();
$('a').each(function () { $('a').each(function () {
$(this).removeClass('active'); $(this).removeClass('active');
}) })
......
...@@ -310,7 +310,7 @@ function nap_menu() { ...@@ -310,7 +310,7 @@ function nap_menu() {
} else { } else {
$nappe_sets = false; $nappe_sets = false;
} }
$menu.= '<li class ="parent-cat" data-page = "' . $category_id . '" data-img = "' . nap_category_image($category_id) . '"><a href="' . get_term_link($cat->slug, 'product_cat') . '">' . $cat->name . '</a>'; $menu.= '<li class ="parent-cat to-slide" data-page = "' . $category_id . '" data-img = "' . nap_category_image($category_id) . '"><a href="' . get_term_link($cat->slug, 'product_cat') . '">' . $cat->name . '</a>';
$args2 = array( $args2 = array(
'taxonomy' => $taxonomy, 'taxonomy' => $taxonomy,
......
<div class="nav-content font-big"> <div class="nav-content font-big">
<?php <?php
$arrow = 'arrow-white'; $arrow = 'arrow-white nav-page';
if (isset($current_page) and $current_page == 'phototheque') { if (isset($current_page) and $current_page == 'phototheque') {
$arrow = 'arrow-blue phototheque'; $arrow = 'arrow-blue phototheque';
} }
?> ?>
<ul class = "<?php echo $arrow ?>"> <ul class = "main-list-nav <?php echo $arrow ?>">
<?php echo nap_menu(); ?> <?php echo nap_menu(); ?>
<li data-page = "uniqpaper" data-img = "<?php echo nap_attachment_image(151);?>"><a href="<?php echo get_permalink(151);?>">Personnalisation</a></li> <li class="to-slide" data-page = "uniqpaper" data-img = "<?php echo nap_attachment_image(151);?>"><a href="<?php echo get_permalink(151);?>">Personnalisation</a></li>
</ul> </ul>
<?php if (!(isset($current_page) and $current_page == 'phototheque')) { ?> <?php if (!(isset($current_page) and $current_page == 'phototheque')) { ?>
<ul class= "font-medium arrow-pink pink-list"> <ul class= "font-medium arrow-pink pink-list">
<li data-page = "stories" data-img = "<?php echo nap_attachment_image(154);?>"><a href="<?php echo get_permalink(154);?>">Stories</a></li> <li class="to-slide" data-page = "stories" data-img = "<?php echo nap_attachment_image(154);?>"><a href="<?php echo get_permalink(154);?>">Stories</a></li>
<li data-page = "contact" data-img = "<?php echo nap_attachment_image(157);?>" ><a href="<?php echo get_permalink(157);?>">Contact</a></li> <li class="to-slide" data-page = "contact" data-img = "<?php echo nap_attachment_image(157);?>" ><a href="<?php echo get_permalink(157);?>">Contact</a></li>
</ul> </ul>
<?php } ?> <?php } ?>
</div> </div>
...@@ -20,7 +20,10 @@ if (!defined('ABSPATH')) { ...@@ -20,7 +20,10 @@ if (!defined('ABSPATH')) {
exit; // Exit if accessed directly exit; // Exit if accessed directly
} }
$current_page = 'catalogue'; $current_page = 'catalogue';
get_header(); if (!(isset($_POST['ajax']))) {
get_header();
}
$product; $product;
$cate = get_queried_object(); $cate = get_queried_object();
$cateID = $cate->term_id; $cateID = $cate->term_id;
...@@ -33,8 +36,9 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of' ...@@ -33,8 +36,9 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
?> ?>
<div class="container clearfix" id="catalogue" data-page = "<?php echo $cateID; ?>"> <div class="container clearfix" id="catalogue" data-page = "<?php echo $cateID; ?>">
<?php if (!(isset($_POST['ajax']))) { ?>
<div class="container-bg abs-full"></div> <div class="container-bg abs-full"></div>
<?php get_sidebar() ?> <?php get_sidebar(); } ?>
<div class="header mobile-nav display--only-mobile blue-bg fixed"> <div class="header mobile-nav display--only-mobile blue-bg fixed">
<div class="nav-wrapper blue-bg"> <div class="nav-wrapper blue-bg">
<ul></ul> <ul></ul>
...@@ -245,4 +249,7 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of' ...@@ -245,4 +249,7 @@ $child_category = get_terms('product_cat', array('parent' => $cateID, 'child_of'
</div> </div>
</div> </div>
</div> </div>
<?php get_footer(); ?> <?php
if (!(isset($_POST['ajax']))) {
get_footer();
} ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment