JS淘宝浏览商品

2021-06-04 19:02

阅读:615

YPE >

标签:htm   node   div   nts   dde   淘宝   top   one   width   

html>
    
    相册 
    
        *{
            margin:0;
            padding:0;

        }
        ul{
            list-style: none;
            overflow: hidden;
        }
        ul li{
            float: left;
            width: 55px;
            height: 40px;
            margin-top: 10px;
            margin-left: 10px;
            border: 2px solid #fff;
        }
            ul li.active{
                border-color: red;
            }
    

        
        
                
  •                 
                        
                    

                
                
  •                 
                        
                    

                
                
  •                 
                        
                    

                
                
  •                 
                        
                    
             
           
      
        var big=document.getElementById(‘img‘);
        var small=document.getElementsByClassName(‘small‘);
        for(var i=0;i
        {
            small[i].onmouseover=function()
            {
                for(var j=0;j
                {
                    small[j].parentNode.parentNode.setAttribute(‘class‘,‘‘);
                }
                var smalls=this.getAttribute(‘src‘);
                big.setAttribute(‘src‘,smalls);

                this.parentNode.parentNode.setAttribute(‘class‘,‘active‘);
            }
        }
        

    JS淘宝浏览商品

    标签:htm   node   div   nts   dde   淘宝   top   one   width   

    原文地址:https://www.cnblogs.com/lxabner/p/12340928.html


    评论


    亲,登录后才可以留言!