| Linux webm010.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 Path : /home/c/u/i/cuisinesj/www/new/wp-content/themes/Avenue/js/ |
| Current File : /home/c/u/i/cuisinesj/www/new/wp-content/themes/Avenue/js/scripts.js |
jQuery(document).ready(function($) {
// Tabs
//When page loads...
$('.tabs-wrapper').each(function() {
$(this).find(".tab_content").hide(); //Hide all content
$(this).find("ul.tabs li:first").addClass("active").show(); //Activate first tab
$(this).find(".tab_content:first").show(); //Show first tab content
});
//On Click Event
$("ul.tabs li").click(function(e) {
$(this).parents('.tabs-wrapper').find("ul.tabs li").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(this).parents('.tabs-wrapper').find(".tab_content").hide(); //Hide all tab content
var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
$(this).parents('.tabs-wrapper').find(activeTab).fadeIn(); //Fade in the active ID content
e.preventDefault();
});
$("ul.tabs li a").click(function(e) {
e.preventDefault();
})
// Implementation of jCarouselLite
$('.anyClass').each(function() {
var id = $(this).attr('id');
var number = id.replace('anyClass_', '');
$('#'+id).jCarouselLite({
btnNext: "#next_"+number,
btnPrev: "#prev_"+number
});
});
$(".toggle-content").hide();
$("h5.toggle").toggle(function(){
$(this).addClass("active");
}, function () {
$(this).removeClass("active");
});
$("h5.toggle").click(function(){
$(this).next(".toggle-content").slideToggle();
});
// Add colorbox to gallery
$('.gallery').each(function(index, obj){
var galleryid = Math.floor(Math.random()*10000);
$(obj).find('a').colorbox({rel:galleryid, maxWidth:'95%', maxHeight:'95%'});
});
$("a.lightbox").colorbox({maxWidth:'95%', maxHeight:'95%'});
// Contact form
$('#contactForm').live('submit', function(e) {
var form = $(this);
var name = $(this).find('[name=pyre_name]').val();
var email = $(this).find('[name=pyre_email]').val();
var message = $(this).find('[name=pyre_message]').val();
if(name == '') {
$(this).find('[name=pyre_name]').addClass('error');
$(this).find('[name=pyre_name]').parent().find('.error_msg').fadeIn();
return false;
} else {
$(this).find('[name=pyre_name]').removeClass('error');
$(this).find('[name=pyre_name]').parent().find('.error_msg').fadeOut();
}
var email_regex = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
if(email == '' || !email_regex.test(email)) {
$(this).find('[name=pyre_email]').addClass('error');
$(this).find('[name=pyre_email]').parent().find('.error_msg').fadeIn();
return false;
} else {
$(this).find('[name=pyre_email]').removeClass('error');
$(this).find('[name=pyre_email]').parent().find('.error_msg').fadeOut();
}
if(message == '') {
$(this).find('[name=pyre_message]').addClass('error');
$(this).find('[name=pyre_message]').parent().find('.error_msg').fadeIn();
return false;
} else {
$(this).find('[name=pyre_message]').removeClass('error');
$(this).find('[name=pyre_message]').parent().find('.error_msg').fadeOut();
}
$.ajax({
url: AvenueVars.ajaxUrl,
data: jQuery(form).serialize()+'&action=pyre_contact_form',
type: 'POST',
success: function() {
$('.email_sent').fadeIn(400).delay(5000).fadeOut(400);
}
});
e.preventDefault();
});
});
/*================================= RESPONSIVE MENU REPLACEMENT =========================*/
jQuery(document).ready(function() {
jQuery('.topNav').parent().addClass('topNavWrapper');
// build drop down for smaller screens
jQuery("<select />").appendTo(".topNavWrapper");
// give it the default option "Go to..."
jQuery("<option />", {
"selected": "selected",
"value": "",
"text": "Go to..."
}).appendTo(".topNavWrapper select");
//populate dropdown with main-menu items
jQuery(".topNavWrapper ul.topNav li a").each(function(){
var menuitem = jQuery(this);
// add - hyphen in frotn of drop-down menu elements to make the
// hierarchy more visible on smaller screened devices where drop-down box is shown
var hyphen_child = '';
if(jQuery(this).parent().parent('.sub-menu').length)
hyphen_child = '- ';
else
hyphen_child = '';
//now create the dropdown box
jQuery("<option />", {
"value": menuitem.attr("href"),
"text": hyphen_child + menuitem.text()
}).appendTo(".topNavWrapper select");
});
//take user to page when select drop down is used.
jQuery(".topNavWrapper select").change(function(){
window.location = jQuery(this).find("option:selected").val();
});
});
jQuery(document).ready(function() {
// build drop down for smaller screens
jQuery("<select />").appendTo("#navigation");
// give it the default option "Go to..."
jQuery("<option />", {
"selected": "selected",
"value": "",
"text": "Go to..."
}).appendTo("#navigation select");
//populate dropdown with main-menu items
jQuery("#navigation ul.menu li a").each(function(){
var menuitem = jQuery(this);
// add - hyphen in frotn of drop-down menu elements to make the
// hierarchy more visible on smaller screened devices where drop-down box is shown
var hyphen_child = '';
if(jQuery(this).parent().parent('.sub-menu').length)
hyphen_child = '- ';
else
hyphen_child = '';
//now create the dropdown box
jQuery("<option />", {
"value": menuitem.attr("href"),
"text": hyphen_child + menuitem.text()
}).appendTo("#navigation select");
});
//take user to page when select drop down is used.
jQuery("#navigation select").change(function(){
window.location = jQuery(this).find("option:selected").val();
});
});
/*================================= FB-LIKE WIDGET auto-width =========================*/
jQuery(document).ready(function() {
if(jQuery('.responsiveX .fb-iframe-widget').length > 0)
{
var contentWidth = jQuery('#wrapper').width();
//console.log('wrapper width is: '+ contentWidth);
if(contentWidth >= 1020)
jQuery('.fb-iframe-widget').width('300');
if(contentWidth < 1020)
jQuery('.fb-iframe-widget').width('215');
if(contentWidth < 768)
jQuery('.fb-iframe-widget').width('396');
if(contentWidth < 420)
jQuery('.fb-iframe-widget').width('276');
}
});
jQuery(window).resize(function() {
if(jQuery('.responsiveX .fb-iframe-widget').length > 0)
{
var contentWidth = jQuery('#wrapper').width();
//console.log('wrapper width is: '+ contentWidth);
if(contentWidth >= 1020)
jQuery('.fb-iframe-widget').width('300');
if(contentWidth < 1020)
jQuery('.fb-iframe-widget').width('215');
if(contentWidth < 768)
jQuery('.fb-iframe-widget').width('396');
if(contentWidth < 420)
jQuery('.fb-iframe-widget').width('276');
}
});