PHP
- 2 ответа
- 0 вопросов
2
Вклад в тег
$result = [];
if(...) {
foreach(... as ...) {
$images = $this->model_catalog_product->getProductImages($result['product_id']);
if(isset($images[0]['image']) && !empty($images)){
$images = $images[0]['image'];
} else {
$images = $image;
}
}
const url="http://example.com/roomUser/BootData.php";
fetch(url)
.then(response => response.json())
.then(BootData => {
console.log(BootData);
});
const url="http://example.com/roomUser/BootData.php";
fetch(url)
.then(response => response.json().then(BootData => {
console.log(BootData);
}));
.block {
clip-path: polygon(0% 40%,100% 0%,100% 100%,0% 100%) margin-box;
margin: 0;
}
попробуйте так..<div class="content">
<div class="filter">
<p>Текст - 1</p>
</div>
<div class="filter">
<p>Текст - 2</p>
</div>
<div class="filter">
<p>Текст - 3</p>
</div>
<div class="filter">
<p>Текст - 4</p>
</div>
<div class="filter">
<p>Текст - 5</p>
</div>
<div class="filter" hidden>
<p>Текст - 6</p>
</div>
<div class="filter" hidden>
<p>Текст - 7</p>
</div>
<div class="filter" hidden>
<p>Текст - 8</p>
</div>
<div class="filter" hidden>
<p>Текст - 9</p>
</div>
<div class="filter" hidden>
<p>Текст - 10</p>
</div>
<p class="show_content">Показать остальное</p>
</div>
$(document).ready(() => {
$('body').on('click', '.show_content' , () => {
var scrollToProduct = $('.filter:hidden');
$('.filter:hidden:lt(5)').slideDown(1000);
if (scrollToProduct.length === 0) $('.show_content').hide() ;
$('html, body').animate({
scrollTop: scrollToProduct.offset().top
}, 1000);
});
});
$(document).ready(() => {
$('body').on('click', '.show_content' , () => {
var scrollToProduct = $('.filter:hidden');
$('.filter:hidden').slideDown(1000);
if (scrollToProduct.length === 0) $('.show_content').hide() ;
$('html, body').animate({
scrollTop: scrollToProduct.offset().top
}, 1000);
});
});
$(document).ready(() => {
$('body').on('click', '.show_content' , () => {
var scrollToProduct = $('.filter:hidden');
$('.filter:hidden').show();
if (scrollToProduct.length === 0) $('.show_content').hide() ;
});
});
var url_json = 'https://www.site.com/json.txt';
function init(){
fetch(url_json)
.then(response => response.json())
.then(_json => {
let artist = document.getElementById('artist');
let title= document.getElementById('title');
artist.innerHTML = _json.artist;
title.innerHTML = _json.title;
});
}
setInterval(init,1000);
var url_json = 'https://www.site.com/json.txt';
function init(){
fetch(url_json)
.then(response => response.json().then(_json => {
let artist = document.getElementById('artist');
let title= document.getElementById('title');
artist.innerHTML = _json.artist;
title.innerHTML = _json.title;
}));
}
setInterval(init,1000);