图片放大

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
		*{
			padding: 0px;
			margin: 0px;
			list-style: none;
		}
		#box{
			width:500px ;
			height: 100px;
			border: 1px solid;
			padding-top: 500px;
			margin: 100px auto;
			background: url(img/8.jpg) no-repeat;
		}
		ul{
			display: flex;
			justify-content: center;
			align-items: center;
			cursor: pointer;
		}
		</style>
	</head>
	<body>
		<div>
   </div>
    <div id="box">
    	<ul>
    		<li id="li1"><img src="img/8.jpg" alt="" style="width: 100px; height: 100px;"></li>
    		<li id="li2"><img src="img/9.jpg" alt="" style="width: 100px; height: 100px;"></li>
    		<li id="lm3"><img src="img/10.jpg" alt="" style="width: 100px; height: 100px;"></li>
    		<li id="lm4"><img src="img/11.jpg" alt="" style="width: 100px; height: 100px;"></li>
    		<li id="lm5"><img src="img/2.jpg" alt="" style="width: 100px; height: 100px;"></li>
    	</ul>
    </div>
    
    <script type="text/html">
  </script>
	<script type="text/html">
		/*window.onload=function(){
			var box=document.getElementById("box");
			//创建节点
			var img=document.createElement("img");
			img.src="img/1.jpg";
			box.appendChild(img);
			var p=document.getElementsByTagName("p");
			box.insertBefore(img,p);
			//删除节点
			//(1)拿到此节点
			var ht=document.getElementById("ht");
			//ht.parentNode.removeChild("ht");
			ht.remove();*/
			window.onload=function(){
			var box=document.getElementById("box");	
			var new=box.cloneNode(true);
			//document.write(new);
			
			document.body.appendChild(new);
				document.write(new);
			}
	</script>
	<script type="text/html">
		window.onload=function(){
			//节点属性
			var box=document.getElementById("box")
			//1/获取:getAttribute(名称)
			document.write(box.getAttribute("box"));
			//2、设置:setAttribute(名称,值)
		    box.setAttribute("box","1111");
		    box.setAttribute("aaa","hhhhhh");
		   //3、删除:removeAttribute(名称)
		   box.removeAttribute("aaa");
		}
	</script>
	<script type="text/html">
		window.onload=function(){
			//1、获取需要的标签
		var icon=document.getElementById("icon");
		var prev=document.getElementById("prev");
		var next=document.getElementById("next");
		//2、监听按钮的点击
		var maxIndex=4,minIndex=1,currentIndex=minIndex;
		prev.onclick=function(){
				if (currentIndex==minIndex){
				currentIndex==maxIndex;
			}else{
				currentIndex --;
			}
		};
			next.onclick=function(){
			if (currentIndex==maxIndex){
				currentIndex==minIndex;
			}else{
				currentIndex ++;
			}
			icon.setAttribute("src","img/icon_1" + currentIndex +".jpg");
		};
		}
	</script>
	<script type="text/html">
		Window.onload=function(){
			var a1=document.getElementById("a1");
			var img=document.getElementsByTagName("img");
			a1.onclick=function(){
			document.write(box.innerHTML);
			document.write(box.innerText);
			}
		}
	</script>
	<script type="text/html">
		window.onload=function(){
			var a1=document.getElementById("a1");
			var icon=document.getElementById("icon");
			a1.onclick=function(){
				if(a1.innerText=="隐藏"){
					icon.style.display="none";
					a1.innerText=="显示";
				}else{
					icon.style.display="block"
					a1.innerText=="隐藏"
				}
			}
		}
	</script>
	<script type="text/html">
		Window.onload=function(){
			//1、获取事件
			var ul=document.getElementById("small");
			var a=ul.getElementsByTagName("a");
			var name=document.getElementById("name");
			var big=document.getElementById("big");
		   //2、绑定事件
		   for(var i=0;i<a.length;i++){
		   	a[i].onclick=function(){
		   		alert("1111");
		   		big.src=this.href;
		   		return false;
		   		
		   	}
		   }
		}
	</script>
	<script type="text/html">
		window.onload=function(){
			/*var inp=document.getElementById("inp");
			inp.value="111";*/
			var box=document.getElementById("box");
			document.write(box.innerHTML);
			window.location.href="http://www.baidu.com";
			console.log(box.innerHTML);
			console.log(box.innerText);
		}
	</script>
	<script type="text/html">
	/*	document.write(document);*/
		document.write(document.body);
		console.log(document.body);
	</script>
	<script type="text/html">
		window.onload=function(){
			//1、获取相应的标签
		var box=document.getElementById("box");
		var two=document.getElementById("two");
		//2、监听鼠标进入
		box.onmouseover=function(){
			//2.1改变背景图片
			this.style.background='url("url(img/7_selected.gif)")';
			//2.2显示小图片
			two.style.display="block";
		};
		box.onmouseout=function(){
			//2.1改变背景图片
			this.style.background='url("url(img/7_normal.gif)")';
			//2.2显示小图片
			two.style.display="none";
		}
		}
	</script>
	<script>
		window.onload=function(){
			
			
			var li1=document.getElementById("li1");
			var li2=document.getElementById("li2");
			var lm3=document.getElementById("lm3");
			var lm4=document.getElementById("lm4");
			var lm5=document.getElementById("lm5");
			var box=document.getElementById("box");
			
			
			li1.onmouseover=function(){
				box.style.background='url("img/8.jpg")';
			};
			li2.onmouseover=function(){
				box.style.background='url("img/9.jpg")'; 
			};
			lm3.onmouseover=function(){
				box.style.background='url(img/10.jpg)'
			}
			lm4.onmouseenter=function(){
				box.style.background='url("img/11.jpg")';
			};
			lm5.onmouseenter=function(){
				box.style.background='url("img/2.jpg")';
			};
		}
	</script>
	
	</body>
</html>

所需图片材料

测试结果图

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
探索全栈前端技术的魅力:HTML+CSS+JS+JQ+Bootstrap网站源码深度解析 在这个数字化时代,构建一个既美观又功能强大的网站成为了许多开发者和企业追逐的目标。本份资源精心汇集了一套完整网站源码,融合了HTML的骨架搭建、CSS的视觉美化、JavaScript的交互逻辑、jQuery的高效操作以及Bootstrap的响应式设计,全方位揭秘了现代网页开发的精髓。 HTML,作为网页的基础,它构建了信息的框架;CSS则赋予网页生动的外观,让设计创意跃然屏上;JavaScript的加入,使网站拥有了灵动的交互体验;jQuery,作为JavaScript的强力辅助,简化了DOM操作与事件处理,让编码更为高效;而Bootstrap的融入,则确保了网站在不同设备上的完美呈现,响应式设计让访问无界限。 通过这份源码,你将: 学习如何高效组织HTML结构,提升页面加载速度与SEO友好度; 掌握CSS高级技巧,如Flexbox与Grid布局,打造适应各种屏幕的视觉盛宴; 理解JavaScript核心概念,动手实现动画、表单验证等动态效果; 利用jQuery插件快速增强用户体验,实现滑动效果、Ajax请求等; 深入Bootstrap框架,掌握移动优先的开发策略,响应式设计信手拈来。 无论是前端开发新手渴望系统学习,还是资深开发者寻求灵感与实用技巧,这份资源都是不可多得的宝藏。立即深入了解,开启你的全栈前端探索之旅,让每一个网页都成为技术与艺术的完美融合!

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值