96编辑器旗下产品
找图
终身
ID:0
到期时间:永久
退出登录
您的位置:首页 > 百科管理 > 详情

div在线设计-div左侧导航菜单

原创:找图网 2023-04-10 20:32:14
  • div+css(技术限定这两个)的网页设计作品,简单的就好,我做模板用,在线等

  • 我自己写的美食网,完全的div+css,代码很规范,优化也做的很好,希望能够真正的帮助到你哈!!

  • div左侧导航菜单

  • <html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">

    <title>导航菜单</title>

    <style type="text/css">

    .titleStyle{

    background-color:#008800;color:#ffffff;border-top:1px solid #FFFFFF;font-size:9pt;cursor:hand;

    }

    .contentStyle{

    background-color:#eeffee;color:blue;font-size:9pt;

    }

    a{

    color:blue;

    }

    body{

    font-size:9pt;

    }

    </style>

    </head>

    <body>

    <script language="JavaScript">

    <!--

    var layerTop=20; //菜单顶边距

    var layerLeft=30; //菜单左边距

    var layerWidth=140; //菜单总宽

    var titleHeight=20; //标题栏高度

    var contentHeight=200; //内容区高度

    var stepNo=10; //移动步数,数值越大移动越慢

    var itemNo=0;runtimes=0;

    ('<span id=itemsLayer style="position:absolute;overflow:hidden;border:1px solid #008800;left:'+layerLeft+';top:'+layerTop+';width:'+layerWidth+';">');

    function addItem(itemTitle,itemContent){

    itemHTML='<div id=item'+itemNo+' itemIndex='+itemNo+' style="position:relative;left:0;top:'+(-contentHeight*itemNo)+';width:'+layerWidth+';"><table width=100% cellspacing="0" cellpadding="0">'+

    '<tr><td height='+titleHeight+' onclick=changeItem('+itemNo+') class="titleStyle" align=center>'+itemTitle+'</td></tr>'+

    '<tr><td height='+contentHeight+' class="contentStyle">'+itemContent+'</td></tr></table></div>';

    (itemHTML);

    itemNo++;

    }

    //添加菜单标题和内容,可任意多项,注意格式:

    addItem('欢迎','<BR> 欢迎光临设计在线!');

    addItem('网页陶吧','<center><a href="#">网页工具</a> <BR><BR><a href="#">技术平台</a> <BR><BR><a href="#">设计理念</a> <BR><BR><a href="#">更多</a></center>');

    addItem('美工教室','<center><a href="#">平面设计 </a> <BR><BR><a href="#">三维空间</a> <BR><BR><a href="#">设计基础</a> <BR><BR><a href="#">更多..</a></center>');

    addItem('Flash','<center><a href="#">基础教程</a> <BR><BR><a href="#">技巧运用</a> <BR><BR><a href="#">实例剖析</a> <BR><BR><a href="#">更多..</a></center>');

    addItem('多媒体','<center><a href="#">DIRECTOR</a> <BR><BR><a href="#">Authorware</a> <BR><BR><a href="#">更多..</a></center>');

    addItem('精品赏析','<center><a href="#">设计精品</a></center>');

    ('</span>')

    =itemNo*titleHeight+contentHeight;

    toItemIndex=itemNo-1;onItemIndex=itemNo-1;

    function changeItem(clickItemIndex){

    toItemIndex=clickItemIndex;

    if(toItemIndex-onItemIndex>0) moveUp(); else moveDown();

    runtimes++;

    if(runtimes>=stepNo){

    onItemIndex=toItemIndex;

    runtimes=0;}

    else

    setTimeout("changeItem(toItemIndex)",10);

    }

    function moveUp(){

    for(i=onItemIndex+1;i<=toItemIndex;i++)

    eval(''+i+'.=parseInt('+i+'.)-contentHeight/stepNo;');

    }

    function moveDown(){

    for(i=onItemIndex;i>toItemIndex;i--)

    eval(''+i+'.=parseInt('+i+'.)+contentHeight/stepNo;');

    }

    changeItem(0);

    //-->

    </script>

    </body>

    </html>

  • jquery如何设计一个div出现动画,掉下来弹动两下之后停止

  • $("#按钮id").click(function(){

    $("#Divid").slideDown("毫秒数");//对display:none才有效,向下弹出,还有slideUp()相反

    });

    基本的显示。

    让其到指定位置,

    $(“#divID”).css({left:"1px",top:"1px"})

    $(“#divID”).animate();//可以实现动画效果。自定义,不太清楚弹几下。。什么意思,但是基本上是这个意思。

    追问:

    可以用animate设置向上弹50px之后掉下,再向上弹50px掉下之后稳定吗?可以的话,给个实例啊。麻烦了。。。

    追答:

    <html>

    <head>

    <title></title>

    <script type="text/javascript" src="

    "></script>

    <script type="text/javascript">

    $(function () {

    $("#btn1").mouseenter(

    function () { $("#div1").slideDown(1000) } //slideDown 和slideUp只对display:none有效

    ).click(function () {

    var div1 = $("#div1"); //获取jquery对象

    var id = setInterval(function () { ({ top: "+=30" }, 1000).animate({ top: "-=30" }, 1000); }, 2000); /*让图片上下浮动,重复执行

    不要链式控制css属性,应在fn。

    */

    (function () {

    clearInterval(id); //清除定时器

    (); //停止动画 2参数,1立即停止动画,第二个清除动画列表 bool

    });

    });

    });

    </script>

    </head>

    <body>

    <input id="btn1" type="button" value="点我就动了" />

    <div id="div1" style="width: 300px; height: 300px; position: absolute; top: 50px;

    left: 50px; background-color: Red; display: none;">

    点我停止动画

    </div>

    </body>

    </html>

    最新文章 更多
    最新素材 更多
    公司介绍 网站地图 图片资讯
    Copyright © 2010-2022 山东找图网络科技有限公司  鲁ICP备18007836号-3  邮箱:15653358549@163.com