用JS,谁有代码啊?

解决方案 »

  1.   

    设置span或者div等HTML元素的title属性就行了,不需要用js
      

  2.   


    div.poptip {
    position: absolute;
    border-bottom: 2px solid #CCC;
    border-right: 2px solid #CCC;
    padding: 0;
    text-align: left;
    width: 300px;
    opacity: 0.9;
    }
    div.innertip {
    background: #FFF;
    border: 1px solid #BBB;
    line-height: 1.8em;
    }
    .poptip > .innertip {
    margin-bottom: -1px;
    }div.poptip a {
    font-weight: normal;
    text-decoration: none;
    }
    div.poptip p.title {
    background: #EEE url(DreamImage/dotline_h.gif) repeat-x bottom;
    font-weight: bold;
    color: #666;
    padding: 0 0.5em;
    margin: 0;
    }
    .poptip .close {
    background: url(DreamImage/icon_del.gif) no-repeat center;
    float: right;
    display: block;
    width: 1.5em;
    text-indent: -9999px;
    overflow: hidden;
    }
    .poptip ul {
    margin: 0.5em 1em;
    padding: 0;
    list-style: none;
    }
    .poptip li {
    background: url(DreamImage/icon_link.gif) no-repeat 0 5px;
    padding-left: 1em;
    height: 1.8em;
    overflow: hidden;
    }
    .poptip .readmore {
    margin: 0 0.5em;
    border-top: 1px solid #DAE1F1;
    text-align: right;
    background: url(DreamImage/icon_list.gif) no-repeat right;
    padding-right: 1em;
    }
    .hnli{
    width:255px; 
    } *
      

  3.   

    如果是用asp:Label这服务器控件来显示文字的话,直接设置它的Tooltip就行了。
      

  4.   

    请参考:http://www.xproer.com/bbs/revert.aspx?fid=6&tid=597