按钮飞线

暑假实验室学习的一个小知识,幽灵按钮

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>线条移动</title>
	</head>
	<style>
	    .contain{
	    	margin: 100px 0 0 200px;
	    	height: 500px;
	    	width: 500px;
	    	border: 2px solid #000;	  
	    	background-color: antiquewhite;   	
	    	position: relative;
	    	
	    }
	    .contain:hover ._right{width: 50px; right: 0px;}
	    .contain:hover ._bottom{height: 50px; bottom: 0px;}
	    .contain:hover ._left{width: 50px; left: 0px;}
	    .contain:hover ._top{height: 50px; top: 0px;}
	    
	    .contain span{position: absolute; background: #000; transition:all 0.6s}
	    .contain ._top{top:152px; left: 352px;height: 0; width: 2px;}
	    .contain ._bottom{bottom: 152px; right: 348px; height: 0; width: 2px;}
	    .contain ._left{top: 150px; left: 160px; width: 0; height: 2px;}
	    .contain ._right{bottom: 146px; right: 160px;  width: 0; height: 2px;}
	    
	    .contain img{
	    	border: 2px solid #000;
	    	margin: 150px;
	    }

	</style>
	<body>	 
		<div class="contain">	
			<span class="_top"></span>
			<span class="_right"></span>
			<span class="_bottom"></span>
			<span class="_left"></span>
			<img src="img/2.jpg/" alt="1">				
		</div>
		
	</body>
</html>


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ECharts 是百度开源的一个数据可视化库,它提供了丰富的图表类型和交互方式。飞线图是 ECharts 中的一种图表类型,用于展示两个地点之间的连接关系。 在 ECharts 中创建飞线图,需要使用 `series` 配置项中的 `lines` 和 `effect` 属性来定义飞线的路径和效果。具体步骤如下: 1. 引入 ECharts 库和主题样式: ```html <script src="https://cdn.jsdelivr.net/npm/echarts@5.2.0/dist/echarts.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/echarts-gl@1.2.0/dist/echarts-gl.min.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.css"> ``` 2. 创建一个包含飞线图的容器: ```html <div id="chartContainer" style="width: 600px; height: 400px;"></div> ``` 3. 使用 JavaScript 代码初始化图表并设置配置项: ```javascript var chart = echarts.init(document.getElementById('chartContainer')); var option = { series: [{ type: 'lines', coordinateSystem: 'geo', data: [...], // 飞线的数据,包含起始点和终点坐标 polyline: true, // 设置为多段线模式 effect: { show: true, // 显示效果 trailLength: 0.2, // 尾迹长度,值为 [0, 1],表示尾迹的百分比长度 symbol: 'arrow', // 箭头样式 symbolSize: 10, // 箭头大小 }, lineStyle: { color: '#fff', // 线条颜色 width: 1, // 线条宽度 opacity: 0.6, // 线条透明度 curveness: 0.2, // 线条曲度,值为 [0, 1],表示曲线的弯曲程度 }, }], // 其他配置项... }; // 使用配置项绘制图表 chart.setOption(option); ``` 以上代码片段演示了如何使用 ECharts 创建一个飞线图。你可以根据你的需求调整数据和配置项,实现自定义的飞线效果。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值