<>
$("#small-search-box-form").on("submit", function(event) {
if ($("#small-searchterms").val() == "") {
alert('Please enter some search keyword');
$("#small-searchterms").focus();
event.preventDefault();
}
});
>
<>
$(document).ready(function() {
var showLinkToResultSearch;
var searchText;
$('#small-searchterms').autocomplete({
delay: 500,
minLength: 3,
source: '/catalog/searchtermautocomplete',
appendTo: '.search-box',
select: function(event, ui) {
$("#small-searchterms").val(ui.item.label);
setLocation(ui.item.producturl);
return false;
},
//append link to the end of list
open: function(event, ui) {
//display link to search page
if (showLinkToResultSearch) {
searchText = document.getElementById("small-searchterms").value;
$(".ui-autocomplete").append("");
}
}
})
.data("ui-autocomplete")._renderItem = function(ul, item) {
var t = item.label;
showLinkToResultSearch = item.showlinktoresultsearch;
//html encode
t = htmlEncode(t);
return $("")
.data("item.autocomplete", item)
.append("" + t + "")
.appendTo(ul);
};
});
>
<>
$(document).ready(function () {
$('.menu-toggle').on('click', function () {
$(this).siblings('.top-menu.mobile').slideToggle('slow');
});
$('.top-menu.mobile .sublist-toggle').on('click', function () {
$(this).siblings('.sublist').slideToggle('slow');
});
});
>
<>
$(document).ready(function () {
$('.footer-block .title').on('click', function () {
var e = window, a = 'inner';
if (!('innerWidth' in window)) {
a = 'client';
e = document.documentElement || document.body;
}
var result = { width: e[a + 'Width'], height: e[a + 'Height'] };
if (result.width < 769) {
$(this).siblings('.list').slideToggle('slow');
}
});
});
>
<>
$(document).ready(function () {
$('.block .title').on('click', function () {
var e = window, a = 'inner';
if (!('innerWidth' in window)) {
a = 'client';
e = document.documentElement || document.body;
}
var result = { width: e[a + 'Width'], height: e[a + 'Height'] };
if (result.width < 1001) {
$(this).siblings('.listbox').slideToggle('slow');
}
});
});
>