Commit 41b5ccf2 authored by imac's avatar imac

[Bugfix]Add header to product page

parent 624e01a0
......@@ -1068,6 +1068,7 @@ aside.news-wrapper {
display: block;
border-radius: 50%;
margin: 0 auto;
position: relative;
}
.list-format ul li{
text-align: center;
......
......@@ -3,8 +3,8 @@ $(function(){
$('a[href^="#"], .easyzoom img').click(function(e){
e.preventDefault();
});
};//END init Function
$.fn.zoom = function(){ //Zoom on Image
};//END init Function
$.fn.zoom = function(){ //Zoom on Image
$(this).on('click', function() {
var zoom = $(this);
$( ".easyzoom" ).each(function( i ) {
......@@ -23,31 +23,31 @@ $.fn.zoom = function(){ //Zoom on Image
}
});
});
} //END Zoom On Image
$.fn.getListColors = function(){
} //END Zoom On Image
$.fn.getListColors = function(){
$(this).each(function(){
var colorWrapper = $(this).find('>span'),
color = colorWrapper.data('color');
colorWrapper.css('background' , color);
})
}
$.fn.getListFormat = function(){
}
$.fn.getListFormat = function(){
$(this).each(function(){
var formatWrapper = $(this).find('>span'),
formatW = formatWrapper.data('width'),
formatH = formatWrapper.data('height');
formatWrapper.css({'height' : formatH , 'width' : formatW });
})
}
$.fn.selectColor= function(){
}
$.fn.selectColor= function(){
$(this).on('click',function(){
$(this).parent().parent().find('li').removeClass('selected');
if (!($(this).hasClass('disabled'))){
$(this).toggleClass('selected');
}
})
}
$.fn.selectFormat = function(){
}
$.fn.selectFormat = function(){
$(this).on('click',function(){
var actifImage = $(this).find('img').data('img-active'),
initialImage = $(this).find('img').data('img');
......@@ -65,8 +65,8 @@ $.fn.selectFormat = function(){
$(this).find('img').attr('src',initialImage);
}
})
}
$.fn.slider_product = function(){
}
$.fn.slider_product = function(){
$('#slides').not('.slick-initialized').slick({
autoplay: false,
arrows:true,
......@@ -76,8 +76,8 @@ $.fn.slider_product = function(){
//centerMode: true,
centerPadding: '0px',
});
}
$.fn.selectSlide = function(slide){
}
$.fn.selectSlide = function(slide){
$(this).click(function(e) {
e.preventDefault();
var data = $(this).data("color"),
......@@ -85,8 +85,8 @@ $.fn.selectSlide = function(slide){
slideno = $(this).data('color');
slide.slick('slickGoTo', dataIndex);
});
}
$.fn.open_gallery = function(){
}
$.fn.open_gallery = function(){
$(this).on('click',function(){
tl = new TimelineMax()
tl.staggerFromTo('.slides-wrapper .gallery article',0.5,{opacity:0,y:100},{opacity:1,y:0},0.1,0);
......@@ -97,16 +97,16 @@ $.fn.open_gallery = function(){
$('.gallery').on('click','.close-btn,article',function(){
tl.reverse();
})
}
$.fn.showRightPanelAnimation = function(removeClass,addClass){
}
$.fn.showRightPanelAnimation = function(removeClass,addClass){
$(this).each(function(i) {
var $li = $(this);
setTimeout(function() {
$li.removeClass(removeClass).addClass(addClass);
}, i*100); // delay 100 ms
});
}
$.fn.showRightPanel = function(){
}
$.fn.showRightPanel = function(){
var wrapper = $(this),
widthPanel = wrapper.outerWidth();
wrapper.css('right', -widthPanel)
......@@ -120,19 +120,19 @@ $.fn.showRightPanel = function(){
$('#product .product-list article').showRightPanelAnimation('fadeInDown','fadeOutUp');
$('.product-details').css('right', 0);
})
}
$.fn.productAnimation = function(){
}
$.fn.productAnimation = function(){
tlProduct = new TimelineMax();
tlProduct.fromTo('.product-images',1,{autoAlpha:0, marginLeft:"-10%"},{autoAlpha:1, marginLeft:"0"},0);
tlProduct.staggerFromTo('.product-details .list',0.7,{opacity:0, marginLeft:"-10%"},{opacity:1, marginLeft:"0"},0.4,0.5);
tlProduct.fromTo('.product-info',1,{autoAlpha:0, marginLeft:"-10%"},{autoAlpha:1, marginLeft:"0"},1.2);
}
$('.product-list article img, .product-list article ul li').on('click', function() {
}
$('.product-list article img, .product-list article ul li').on('click', function() {
$('head').append($('.header-shop'));
var toLink = $(this).data('link');
$('.load-page').parent().addClass('active');
$('.load-page').load(toLink,function(){
$('.list-color li').getListColors();
//$('.list-format li').getListFormat();
$('.list-color li').selectColor();
$('.list-format li').selectFormat();
$('#zoom').zoom();
......@@ -144,10 +144,12 @@ $('.product-list article img, .product-list article ul li').on('click', function
$.fn.productAnimation();
$('#product .product-list').showRightPanel();
$.fn.slider_product();
},800)
$('.list-color li').selectColor();
$('.list-format li').selectFormat();
},500)
$('.download-btn').click(function(e){
e.stopPropagation();
});
});
})
})
});
\ No newline at end of file
......@@ -12,7 +12,7 @@
</div>
<div class="row right">
<ul>
<li><a href="#">newsletter</a></li>
<li class='nl'><a href="#">newsletter</a></li>
<li><a href="<?php echo get_permalink(260)?>">téléchargements</a></li>
<li><a href="phototheque.php">phototèque</a></li>
<li><a href="<?php echo get_permalink(171)?>">mentions légales</a></li>
......
<?php wp_head(); //get_header( 'shop' );?>
<?php while (have_posts()) : the_post(); ?>
<?php wc_get_template_part('content', 'single-product'); ?>
<?php endwhile; // end of the loop. ?>
<?php get_header('shop'); ?>
<?php
while (have_posts()) : the_post();
wc_get_template_part('content', 'single-product');
endwhile; // end of the loop.
?>
<?php get_footer('shop'); ?>
\ No newline at end of file
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