|
本帖最后由 海带丝 于 2014-1-8 10:46 编辑
网站软件介绍
B/S软件体系统结构
动态网站介绍
动态网站开发所需要的Web构件
开发选项卡实例
通过实例了解Web构件
源码部分:- card.css
- body {
- font-size:12px;
- }
- #main {
- width:300px;
- height:200px;
- }
- #main h3 {
- width:80px;
- height:25px;
- background:#ddd;
- float:left;
- margin:0px;
- padding:0px;
- text-align:center;
- line-height:25px;
- font-size:12px;
- margin-right:2px;
- border:2px solid white;
- }
- a {
- color:white;
- }
- #main #content {
- background:#888;
- width:300px;
- height:175px;
- float:left;
- }
- #tit .titin {
- border:2px solid #888;
- background:#888;
- }
复制代码 card.js- $(function(){
- $("#content").load("card.php?cid=1");
-
- var dt=null;
- $("#main #tit h3").mouseover(function(){
- var obj=$(this);
- dt=setTimeout(function(){
- obj.addClass("titin").siblings("h3").removeClass("titin");
- $("#content").load(obj.children("a").eq(0).attr("href"));
- }, 300)
-
- }).mouseout(function(){
- clearTimeout(dt);
- });
- });
复制代码 card.php- <?php
- $cid=$_GET["cid"];
- $mysqli=new mysqli("localhost", "root", "123456", "card");
- $result=$mysqli->query("select id, title from card where cid={$cid}");
- while($row=$result->fetch_assoc()){
- echo '<ul>';
- echo '<li><a href="con.php?id='.$row["id"].'">'.$row["title"].'</a></li>';
- echo '</ul>';
- }
复制代码 card.sql- create table card(
- id int,
- cid int,
- title varchar(60)
- );
- insert into card(id, cid, title) values(1, 1, '1111111111111111111');
- insert into card(id, cid, title) values(2, 1, '2222222222222222222');
- insert into card(id, cid, title) values(3, 1, '3333333333333333333');
- insert into card(id, cid, title) values(4, 2, '444444444444444444');
- insert into card(id, cid, title) values(5, 2, '555555555555555555');
- insert into card(id, cid, title) values(6, 2, '666666666666666666');
- insert into card(id, cid, title) values(7, 3, '7777777777777777');
- insert into card(id, cid, title) values(8, 3, '888888888888888888');
- insert into card(id, cid, title) values(9, 3, '9999999999999999999999');
复制代码 card.html- <html>
- <head>
- <title>网页选项卡</title>
- <link rel="stylesheet" type="text/css" href="card.css">
- <script src="jquery.js"></script>
- <script src="card.js"></script>
- </head>
- <body>
- <div id="main">
- <div id="tit">
- <h3 class="titin"><a href="card.php?cid=1">第一页</a></h3>
- <h3><a href="card.php?cid=2">第二页</a></h3>
- <h3><a href="card.php?cid=3">第三页</a></h3>
- </div>
- <div id="content">
- </div>
- </div>
- </body>
- </html>
复制代码 由于文件过大,不允许上传所以在百度网盘分享了,下载地址在上传文件中,象征性的收费1个金币;
下载地址:
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|