zoukankan      html  css  js  c++  java
  • [orginal]Toolbar control based on web design


    abstract : toolbar is one of the most important controls for design  desktop ,web interface. today we try to explain how to create toolbar  from ABC .

     with nice look body, easy to control and invoking.

    physically: the toolbar is container that hold other element such image ,text or even more complex control like list,combox  with in inline display ,

    from html point of view we can say  each element of the toolbar is LI ,the toolbar it'self is UL. it is not easy as i said  we will see more below .

    logically: we  will see the three logic basic aspects for the toolbar  that is css,js,and html.

    css:

     

    /*ul*/

    .Toolbar

    {

        width
    :600px;

        height
    :64px;

        position
    :absolute;

        border
    :1px #C1C5CD solid;

        list-style
    :none;

        background-repeat
    :repeat-x;

        margin
    :0px;

        padding
    :0px 0px 0px 0px;

        

    }



    .ToolbarItem

    {

        display
    :inline;

        margin-left
    :0px;

        margin-top
    :0px;

        width
    :auto;

        height
    :inherit;

        position
    :static;

        color
    :black;

        float
    :left;

        cursor
    :default;

        position
    :absolute;

    }





    .toolbarItemBurron

    {

        position
    :absolute;

        cursor
    :default;

        background-repeat
    :no-repeat;

      

    }



    /*button caption*/

    .toolbarItemBurron .toolbarItemCaption

    {

        cursor
    :default;

        text-align
    :center;

        margin-left
    :0px;

        margin-top
    :0px;

        position
    :absolute;

        font-family
    : 宋体;

        font-size
    : 12px;



    }




    JS: 

     from js point of view  we consider how to create the toolbar auto-code  that is to mean the user will not asked to create html code , the js here to accomplish all these functions , below we go with more details  starting from the toolbar items .

     Toolbar Item:

    1- create the item in js code : 

    here enable the function to create js element and tags dynamically  for each element with dynamically naming 


     function ToolbarItemCode(parent)

    {

      
    var div=document.createElement('div'); // the border

          div.id
    =parent+'tbItem';

          div.className
    ='toolbarItemBurron';

      
    var pa=document.getElementById(parent);

          pa.appendChild(div); 



     

    2- class of the toolbar item :

    here we go the toolbar item as object mean  the class of the toolbar item that is to say each element in the toolbar is an entity that is different  from other elements.

    here is the class with most important methods and properties as you will see , all these  methods provide practical way to control the items of the tab independently ,also provide dynamic layout for each item.

    // the class of the toolbar item

    Code

     toolbar:

    after  we write the code for each item of the toolbar , just need to invoke it here , the toolbar is also object that contain methods and properties each one has it's own flavor :

    we start  by creating the html code dynamically using js as below :

    Code

    here is class object:

    Code

    the last step is how to create toolbar with multiple items , here we go the html code :

    1-put the headers in the head part of html: 

    <link rel="stylesheet" type="text/css" href="ToolBar.css"/>

    <script language="javascript" type="text/javascript" src="ToolBar.js"></script>

    2-add only one html line code that is where to put the toolbar

     

     <div id="pid"></div> 

    2- call the js object

     as you will we consider two aspects when we invoke the toolbar object , first the toolbar itself second the items.

    we create a toolbar in the 'pid' tag , the toolbar has 700 px width   and 64 px height , 6 items are in the toolbar , each has it's won caption  with dynamic name and layout:

    Code

      

     

     thanks

    Ammar Hawbani  

      

  • 相关阅读:
    Storm概念学习系列之storm出现的背景
    Storm概念学习系列之什么是实时流计算?
    Storm概念学习系列之storm-starter项目(完整版)(博主推荐)
    JAVA 毕业设计 辅导
    可视化的Redis数据库管理工具redis-desktop-manager的初步使用(图文详解)
    CentOS 7的安装详解
    GT-----如何做Android应用流量测试?
    性能测试开始前必知知识点
    【UI】自动化用例设计技巧
    国外免费接收短信验证码平台网站
  • 原文地址:https://www.cnblogs.com/ammar/p/1590807.html
Copyright © 2011-2022 走看看