ks


使圖片放在一行

ul{
width: 1200px;
list-style: none;
display: flex;
padding: 0px;
justify-content: space-between;
align-items: center;
}

使用flex步局

//鼠標懸浮小圖片顯示大圖片

window.onload=function(){
var imgs=document.querySelectorAll(".small");//獲取小圖片
var big=document.querySelector(".big");//獲取大圖片
for (let i = 0; i < imgs.length; i++) {
//圖片移動時執行時的方法
imgs[i].onmousemove=function(e){
big.style.top=e.y+10+"px";
big.style.left=e.x+10+"px";
big.src=this.src;
}
imgs[i].onmouseout=function(){
big.style.display="none";
}
imgs[i].onmouseenter=function(){
big.style.display="block";
}
}
}

全選/全不選

$(function(){
//全選/全不選
$("#chkAll").change(function(){
var gu1= $(this).prop("checked");
$(":checkbox:not([id])").prop("checked",gu1);
})
})
$(function(){
// 刪除當前行
$("button").click(function(){
var gu =$(this).data("del");
// alert("您確定要刪除編號為:"+gu+"的商品?");
if(confirm("您確定要刪除編號為"+gu+"的商品?")){
$(this).closest('tr').remove();
}
})
})

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM