头闻号

东莞市道滘俊钰工艺品加工店

喷涂加工|室内涂料|综合性公司|涂料、油漆|腻子|木器涂料

首页 > 新闻中心 > 科技常识:css 借助autoflow 属性 实现 选座位效果
科技常识:css 借助autoflow 属性 实现 选座位效果
发布时间:2024-10-05 23:21:36        浏览次数:5        返回列表

今天小编跟大家讲解下有关css 借助autoflow 属性 实现 选座位效果 ,相信小伙伴们对这个话题应该有所关注吧,小编也收集到了有关css 借助autoflow 属性 实现 选座位效果 的相关资料,希望小伙伴们看了有所帮助。

1.autoflow属性 如果元素内容的长宽超出元素本身的长宽则会出现滚动条

<HTML> <HEAD> <TITLE>测试表格内的滚动条</TITLE> </HEAD> <BODY> <div id="wins" style="position:absolute;height:200;width:200;overflow:auto;background:#EEEEEE;"> <p>pppppppppppppppppppppppppppppppppppppppppppppppppp </p> <p>pppppppppppppppppppppppppppppppppppppppppppppppppp </p> <p>ppppppppppppppppppppppppp </p> <p>ppppppppppppppppppppppppp </p> <p>ppppppppppppppppppppppppp </p> <p>ppppppppppppppppppppppppp </p> <p>ppppppppppppppppppppppppp </p> <p>ppppppppppppppppppppppppp </p> <p>ppppppppppppppppppppppppp </p> <p>ppppppppppppppppppppppppp </p> <p>ppppppppppppppppppppppppp </p> <p>ppppppppppppppppppppppppp </p> </div></BODY> </HTML>

效果如下

2.选座位页面

<html><head> <meta charset="utf-8"> <title>座位</title> <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"> <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script> <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script> <style type="text/css"> table tr td{ padding: 5px; } </style> </head> <script> function createTable(){var DivW=600;var DivH=400;var length=30;var height=$("#h").val()/1;var width=$("#w").val()/1;var TableW=width*(length+3);var TableH=height*(length+3);$(".main").empty();$(".main").width(TableW).height(TableH);for(var a=0;a<height+1;a++){ var str="<tr>"; for(var b=0;b<width+1;b++){ if(a==0&&b>0){ str+='<td height="30px" width="30px">'+b+'</td>'; } if(b==0&&a>0){ str+='<td height="30px" width="30px">'+a+'</td>'; } if(b>0&&a>0){ str+='<td height="30px" width="30px" ><img src=http://xyrl.com/skin/7ke/image/nopic.gif width="30px" height="30px" /></td>'; } if(a==0&&b==0){ str+='<td height="30px" width="30px"></td>'; } } str+="</tr>"; $(".main").append(str);} } </script><body><!-- 按钮触发模态框 --><button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal" onclick="createTable()"> 座位</button><input type="text" id="h" />排<input type="text" id="w" />座<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div id="wins" style="position:absolute;height:400;width:600;overflow:auto;background:#ffffff;"> <table class="main" style="text-align:center;"> </table> </div> </div> </div></div></body></html>

效果如下

总结

以上所述是小编给大家介绍的css 借助autoflow 属性 实现 选座位效果 希望对大家有所帮助 如果大家有任何疑问请给我留言 小编会及时回复大家的。在此也非常感谢大家对爱蒂网站的支持!

来源:爱蒂网