$(document).on("scroll", function(){
/* if($(document).scrollTop() > 100){
$(".imgLogo").addClass("shrink");
$(".hide-scroll").hide(0);
$(".mainMenu").addClass( 'scrolled' );
$(".menu-btn").attr( 'style', 'font-size: 12px;').animate();
$(".menu-btn i").attr( 'style', 'font-size: 40px;').animate();
}else {
$(".imgLogo").removeClass("shrink");
$(".hide-scroll").show(0);
$(".mainMenu").removeClass( 'scrolled');
$(".menu-btn").attr( 'style', 'font-size: 22px;').animate();
$(".menu-btn i").attr( 'style', 'font-size: 69px;').animate();
}
*/
});
//$('.dctoHover').after( "
CYBERDAY
");
$(document).ready(function () {
$('.dropdown-subcategories').hover(function(){
$('.subcategories').hide();
$('.subcategories[data-id=' + $(this).data('id') + ']').show();
});
$('div.mainMenu').mouseleave(function(){
$('.subcategories').hide();
});
$('.filterBy').on('click', function(){
$('.mainFilters').animate({ left: "0"}).show();
$('.hover').fadeIn(500);
});
$('.hover').on('click', function(){
$('.mainFilters').animate({ left: "-200px"});
$('.hover').fadeOut(500);
});
$('.closest').click(function() {
$('.landing-overlay').fadeOut(500).hide(0);
$('.overlay').fadeOut(300).hide(0);
});
$('.landing-overlay').click(function() {
$('.landing-overlay').fadeOut(500).hide(0);
$('.overlay').fadeOut(300).hide(500);
});
$('.orderResults').change( function (e){
$.post("includes/orderSessions.php",{id: $('.orderResults option:selected').val() },function(e){
parent.location.reload(true);
});
});
$('.searchIn').keyup( function(e){
$.post( 'includes/searchIn.php', { name: $(this).val() }, function(x) {
$('.searchResults').html(x);
});
});
$('[name=product]').click(function() {
$('label').removeClass('checked');
$('.available-block').hide(0);
$('button').attr('disabled', 'disabled');
if($('[name=product]').is(':checked')) {
$('.available-block').show(0);
if($(this).data('stockf')>0&&$(this).data('stockp')<=0){
$('.line-stockf').show();
$('.line-stockp').show();
$('.available-stockf').html('');
$('.available-stockp').html('');
}
if($(this).data('stockp')>0&&$(this).data('stockf')<=0){
$('.line-stockf').show();
$('.line-stockp').show();
$('.available-stockf').html('');
$('.available-stockp').html('');
}
if($(this).data('stockp')<=0&&$(this).data('stockf')<=0){
$('.line-stockf').show();
$('.line-stockp').show();
$('.available-stockf').html('');
$('.available-stockp').html('');
}
if($(this).data('stockp')>0&&$(this).data('stockf')>0){
$('.line-stockf').show();
$('.line-stockp').show();
$('.available-stockf').html('');
$('.available-stockp').html('');
}
$('label[for= ' + $(this).attr('id') + ']').addClass('checked');
$('button').removeAttr('disabled');
}
});
$('[name=typeShipping]').click(function() {
$('label').removeClass('checked2');
$('#confirmS').show();
if($('[name=typeShipping]').is(':checked')) {
$('label[for= ' + $(this).attr('id') + ']').addClass('checked2');
}
});
$('a.fadex').click(function(){
$('#Time1').fadeIn();
});
// top panel Show & Hide
$( ".close-btn" ).click(function() {
$( ".top .row" ).toggle( "blind", 300 );
});
//scroll to top link
$('.scroll-top').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
//responsive menu
$('').appendTo('header nav');
$('', {
'selected': 'selected',
'value' : '',
'text' : 'Select a Page...'
}).appendTo('header nav select');
$('#menu a').each(function() {
var el = $(this);
if(el.parents('#menu ul').length) {
$('', {
'value': el.attr('href'),
'text': '... ' + el.text()
}).appendTo('nav select');
} else {
$('', {
'value': el.attr('href'),
'text': el.text()
}).appendTo('nav select');
}
});
$('header nav select').change(function() {
window.location = $(this).find('option:selected').val();
});
$('.containerRate .rate-star').hover( function(e){
var cursor = $(this).data('id');
$('.rate-star').removeClass('active');
$('.rate-star').each( function(e){
if($(this).data('id')<=cursor){
$(this).addClass('active');
}
});
}, function(e){
var current = $(this).data('current');
$('.rate-star').removeClass('active');
$('.rate-star').each( function(e){
if($(this).data('id')<=current){
$(this).addClass('active');
}
});
});
$('.rate-star').click( function(e){
$.post( "controller/rate",{ rate:$(this).data('id'),article:$(this).data('article')},function(data){
$(".containerRate").html(data);
});
});
});