我想用js写图片点击后放大的效果,怎么写,求助

2025-03-04 16:15:28
推荐回答(1个)
回答1:


    
        
        
    
    
        
    
    
            $(function(){
                $("#img1").click(function(){
                    var width = $(this).width();
                    if(width==100)
                    {
                        $(this).width(200);
                        $(this).height(300);
                    }
                    else
                    {
                        $(this).width(100);
                        $(this).height(150);
                    }
                });
            });