onscroll=Funktioun (){
if(show_process==0 && more_images_num >0 && images_group_index < more_images_num){
var showflag=isMoreShow();
if(showflag){
Dokument.getElementById("advert_images_more").className='advert_images_more';
showMoreImages();//显示更多的图片
Dokument.getElementById("advert_images_more").className='advert_images_more advert_hide';
}aner{
Dokument.getElementById("advert_images_more").className='advert_images_more advert_hide';
}
}
}
/**
* 显示更多的图片
*/
Funktioun showMoreImages(){
show_process=1;
var contentbox=document.getElementById("advert_images_list_item");
var index=images_group_index+1;
if(index < more_images_num){
var images=more_images[index];
Biller.forEach(item=>{
var lis=document.createElement('div');
lis.className = "advert-grid-item";
var link=document.createElement('a');
link.Titel = Artikel.alt;
link.href = Artikel.link_url;
link.dataset.src = item.src;
link.dataset.alt = item.alt;
link.className='advert_image_link';
link.innerHTML='
';
lis.appendChild(link);
contentbox.appendChild (ass); lueden Bild (link, item.src, Artikel.alt);
});
images_group_index=index;
}
show_process=0;
}
/**
* 加载图片
* @param obj
* @param src
* @param alt
*/
Funktioun loadingImage(obj,src,alt){
var img=nei Bild();
img.onload=Funktioun (){
obj.innerHTML="";
obj.appendChild (dëst);
}
img.src=src;
img.alt=alt;
}
/**
* 更多的图标是否显示出来了
* @returs {boolean}
*/
Funktioun isMoreShow(){
lass offsetTop = document.getElementById("advert_images_more").offsetTop;//元素距离顶部的距离
loosse pageYOffset = Fënster.pageYOffset;//整个页面顶部滚动的高度
loosse innerHeight = Fënster.innerHeight;//网页可见的高度
if(offsetTop-pageYOffset < innerHeight){
zréck wouer;
}aner{
zréck falsch;
}
}
/**
* 显示选择菜单
*/
Funktioun showAllMenu(){
loosse Héicht = Dokument.Kierper.Scroll Héicht;
Dokument.getElementById("advert_menu_all").className = "advert_menu_all";
Dokument.getElementById("advert_bg").className = "advert_bg";
Dokument.getElementById("advert_bg").Stil.Héicht = Héicht;
konsoll.log (Héicht);
}
/**
* 隐藏选择菜单
*/
Funktioun hideAllMenu(){
Dokument.getElementById("advert_menu_all").className = "advert_menu_all advert_hide";
Dokument.getElementById("advert_bg").className = "advert_bg advert_hide";
}
//----初始化数据-------
// Fënster.onload=Funktioun (){
var content=document.getElementById("advert_moredata").Wäert;
more_images=JSON.parse (Inhalt);
more_images_num=more_images.Längt;
var objs=document.getElementsByClassName("advert_image_link");
fir(var i=0;i< obj.length;i++){
var item=objs[i];
var alt=item.dataset.alt;
var src=item.dataset.src;
loadingImage(item,src,alt);
}
// }