2nd update
This commit is contained in:
17
script.js
17
script.js
@@ -1,19 +1,4 @@
|
||||
const searchIcon = document.querySelector('.search i');
|
||||
const searchInput = document.querySelector('.search input');
|
||||
searchIcon.onclick = () => {
|
||||
searchIcon.style.display = 'none';
|
||||
searchIcon.parentElement.querySelector('input').style.display = 'block';
|
||||
searchIcon.parentElement.querySelector('input').focus();
|
||||
};
|
||||
searchInput.onkeyup = event => {
|
||||
if (event.keyCode === 13 && searchInput.value.length > 0) {
|
||||
if (rewrite_url) {
|
||||
window.location.href = encodeURI(base_url + 'search/' + searchInput.value);
|
||||
} else {
|
||||
window.location.href = encodeURI(base_url + 'index.php?page=search&query=' + searchInput.value);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (document.querySelector('.product-img-small')) {
|
||||
let imgs = document.querySelectorAll('.product-img-small img');
|
||||
let mainImg = document.querySelector('.product-img-large img');
|
||||
|
||||
Reference in New Issue
Block a user