<script type="text/javascript" src="http://sfhelp.baidu.com/msg/js/987/739987.js" charset="gb2312"></script> 

解决方案 »

  1.   

    以前写的个  把背景改成相应的图片背景就差不多了 (PS:从来没考虑过兼容问题)
    <style type="text/css">
    <!--
    #xx{ position:absolute; width:200px;;border:1px solid #999999;}
    #title{font-size:12px;height:30px;width:100%;background:#0099FF;}
    #content{font-size:12px;height:170px;width:100%;}
    -->
    </style>
    <script>
    var Initialization =true     //判断div是否滚动下去了 true没下去  false下去了
    var Opacity =100             //设置透明度
    var i=0                      //移动的次数   根据长度算和移动速度算出来的
    window.onresize = resizeDiv;
    window.onscroll = resizeDiv;
    function resizeDiv()
    {
    divHeight = parseInt(document.getElementById("xx").offsetHeight,10);
    divWidth = parseInt(document.getElementById("xx").offsetWidth,10);
    docWidth = document.body.clientWidth;
    docHeight = document.body.clientHeight;
    if(Initialization)
    {document.getElementById("xx").style.top = docHeight + parseInt(document.body.scrollTop,10) - divHeight ;
    document.getElementById("xx").style.left = docWidth + parseInt(document.body.scrollLeft,10) - divWidth;}
    else
    {
    document.getElementById("xx").style.top = docHeight + parseInt(document.body.scrollTop,10) - divHeight;
    }
    }function move(){
    if(Initialization)
        { if(i!=34)
         {
           i++;
           document.getElementById("xx").style.top=parseInt(document.getElementById("xx").style.top)+5
           tt=setTimeout("move()",10)
         }
        else
       {window.clearTimeout(tt); Initialization=false;document.getElementById("content").style.display = "none";}
    }
    else
    {
      if(i!=0)
       {
       document.getElementById("content").style.display = "";
         i--
         document.getElementById("xx").style.top=parseInt(document.getElementById("xx").style.top)-5
         tt=setTimeout("move()",10)
       }
       else
       {Initialization=true;window.clearTimeout(tt)}
    }
    }function disappear(){
    if(Opacity==0)
    {window.clearTimeout(time);
    document.getElementById('xx').style.display="none";}
    else
    {
    Opacity=Opacity-10;
    document.getElementById('xx').style.filter = "Alpha(opacity="+Opacity+")";
    time=setTimeout("disappear()",50)
    }
    }
    </script> <body onload="resizeDiv()">
    hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>hehe<br>
    <div id="xx">
    <div id="title">
    <span style="top:7px;left:10px; position:relative;">新闻列表</span>
    <span style="top:7px;left:105px; position:relative; cursor:hand;" onClick="move()">--</span>
    <span style="top:7px;left:110px; position:relative; cursor:hand;" onClick="disappear()">X</span>
    </div>
    <div id="content"></div>
    </div>
    </body>
      

  2.   

    补充1楼
    var sf_mess_lib = {
    loadCss: function (url) {
    var css = document.createElement('link');
    css.setAttribute('rel', 'stylesheet');
    css.setAttribute('type', 'text/css');
    css.setAttribute('href', url);
    document.getElementsByTagName('head')[0].appendChild(css);
    },

    getElement: function (id) {
    return document.getElementById(id);
    }
    }var sf_mess_browser = {};
    sf_mess_browser.ieVersion = /msie (\d+)/.exec(navigator.userAgent.toLowerCase());
    sf_mess_browser.higherThanIE6 = sf_mess_browser.ieVersion && parseInt(sf_mess_browser.ieVersion[1]) > 6;
    sf_mess_browser.onQuirkMode = document.compatMode && document.compatMode.indexOf('Back') == 0;if(sf_mess_browser.ieVersion && !(sf_mess_browser.higherThanIE6)) {
    document.execCommand("BackgroundImageCache", false, true);
    }
    var SF_MESS_FORM_NAME = "SfMessForm";
    var SF_MESS_WRAP_ID  = "SfMessWrap";
    var SF_MESS_HEAD_ID  = "SfMessHead";
    var SF_MESS_TITLE_ID = "SfMessTitle";
    var SF_MESS_HEAD_ICON_ID  = "SfMessHeadIcon";
    var SF_MESS_BODY_ID  = "SfMessBody";
    var SF_MESS_BODY_TOP_ID  = "SfMessBodyTop";
    var SF_MESS_BODY_MID_ID  = "SfMessBodyMid";
    var SF_MESS_BODY_BOTTOM_ID  = "SfMessBodyBottom";
    var SF_MESS_BODY_FOOT_ID  = "SfMessBodyFoot"
    var SF_MESS_SUBMIT_ID  = "SfMessSubmit";
    var SF_MESS_COPY_ID  = "SfMessCopy";
    var SF_MESS_FRAME_ID  = "SfMessCopyFrame";
    var SF_MESS_TIP_CLASS  = "SfMessTip";
    var SF_MESS_ICON_OPEN_CLASS = "SfMessIconOpen";
    var SF_MESS_ICON_CLOSE_CLASS = "SfMessIconClose";
    var SF_MESS_PREFIX  = "SfMess_";var SF_MESS_POST_ACTION         = "http://myshifen.baidu.com/sfmess/index.php?module=Front&controller=Messlist&action=addmess";
    var SF_MESS_THEME_PATH = 'http://myshifen.baidu.com/sfmess/themes/';
    var SF_MESS_PATH = "http://myshifen.baidu.com/sfmess/";var sf_mess_layout_mod = [];
    sf_mess_layout_mod.push('<div id="${SF_MESS_WRAP_ID}" style="top:1000px;${sf_pos_style}">',
    '<iframe id="${SF_MESS_FRAME_ID}" name="${SF_MESS_FRAME_ID}" style="display:none;"></iframe>',
    '<form style="margin:0;" target="${SF_MESS_FRAME_ID}" name="${SF_MESS_FORM_NAME}" method="post" action="${SF_MESS_POST_ACTION}">',
    '<div id="${SF_MESS_HEAD_ID}">',
    '<div id="${SF_MESS_TITLE_ID}">${sf_mess_cfg.title}</div>',
    '<div class="${SF_MESS_ICON_OPEN_CLASS}" id="${SF_MESS_HEAD_ICON_ID}"></div>',
    '</div>',
    '<div id="${SF_MESS_BODY_ID}">',
    '<div id="${SF_MESS_BODY_TOP_ID}"></div>',
    '<div id="${SF_MESS_BODY_MID_ID}"></div>',
    '<div id="${SF_MESS_BODY_BOTTOM_ID}">',
    '<input id="${SF_MESS_SUBMIT_ID}" type="submit" value="${sf_mess_cfg.send}">',
    '<div id="${SF_MESS_COPY_ID}">${sf_mess_cfg.copyright}</div>',
    '</div>',
    '<div id="${SF_MESS_BODY_FOOT_ID}"></div>',
    '<input type="hidden" name="ownerid" value="${owner}"></div>',
    '</form>',
    '</div>');if (window.sf_mess_preview) SF_MESS_POST_ACTION = "";var sf_mess_validate = {
    mustValidate: function (name, defaultValue) {
    var colValue = document.getElementById(SF_MESS_PREFIX + name).value.replace(/(^\s*)|(\s*$)/g, "");
    if (colValue.length <= 0 || 
    colValue == filtInnertip(defaultValue)) {
    return false;
    }
    return true;
    },
    emailValidate: function (innertip) {
    var emailEl = document.getElementById(SF_MESS_PREFIX + 'email');
    if (emailEl) {
    if (emailEl.value == innertip || emailEl.value.length == 0) return true;
    return /^[-0-9.a-z_]+@([0-9a-z][-0-9.a-z_]+\.)+[a-z0-9]{2,4}$/.test(document.getElementById(SF_MESS_PREFIX + 'email').value);
    }

    return true;
    },
    messValidate: function () {
    var messVal = document[SF_MESS_FORM_NAME].getElementsByTagName('textarea')[0].value;
    var len = messVal.length;
    for (var i = 0, l = len; i < l; i++) {
    if (messVal.charCodeAt(i) > 127)
    len ++;
    }
    return len <= 2000;
    },
    init: function () {
    document[SF_MESS_FORM_NAME].onsubmit = function () {
    if (window.sf_mess_preview) return false;
    var pass = true;
    var msg = [];

    var intSucNum = 0;
    var noContact = true;

    var aetMsg = [];
    for (var i = 0, l = sf_mess_cols.length; i < l; i++) {
    var inputCfg = sf_mess_cols[i];
    if(inputCfg.mbtype == 'address' 
    || inputCfg.mbtype == 'tel'
    || inputCfg.mbtype == 'email') {
    if(sf_mess_validate.mustValidate(inputCfg.idname,inputCfg.innertip)) {
    intSucNum++;
    }else{
    aetMsg.push(sf_mess_msg.prefix + inputCfg.tip);
    }
    noContact = false;
    }
    }
    if(intSucNum==0 && !noContact){
    pass = false;
    msg.push(aetMsg.join('\n'));
    } var oriColumnsState = {'address':0,'tel':0,'email':0};
    var oriColumns = {};
    var emailInnertip = "";

    for (var i = 0, l = sf_mess_cols.length; i < l; i++) {
    var inputCfg = sf_mess_cols[i];
    switch (inputCfg.mbtype) {
    case 'message':
    case 'must':
    if(!sf_mess_validate.mustValidate(inputCfg.idname,inputCfg.innertip)) {
    pass = false;
    msg.push(sf_mess_msg.prefix + inputCfg.tip);
    }
    break;
    case 'email':
    emailInnertip = inputCfg.innertip;
    break;
    default:
    break;
    }
    } if (!sf_mess_validate.emailValidate(emailInnertip)) {
    pass = false;
    msg.push(sf_mess_msg.emailErr);
    } if(!sf_mess_validate.messValidate()) {
    pass = false;
    msg.push(sf_mess_msg.messErr);
    }

    if(!pass) {
    alert(msg.join('\n'));
    } else {
    for (var i = 0, l = sf_mess_cols.length; i < l; i++) {
    var inputCfg = sf_mess_cols[i];
    var hideEl = document.getElementById(SF_MESS_PREFIX + inputCfg.idname + 'hide');
    document.getElementById(SF_MESS_PREFIX + inputCfg.idname).disabled = true;
    if (document.getElementById(SF_MESS_PREFIX + inputCfg.idname).value == inputCfg.innertip) {
    hideEl.value = '';
    continue;
    }
    var utf8Value = encodeURIComponent(document.getElementById(SF_MESS_PREFIX + inputCfg.idname).value);
    hideEl.value = utf8Value;
    }
    sf_mess_lib.getElement(SF_MESS_SUBMIT_ID).disabled = true;
    sfMessTimes = 0;
    sfMessSubmitMonitor();
    }
    return pass;
    }
    }
    }var sfMessTimes;
    function sfMessSubmitMonitor () {
        try{
            var hash = sf_mess_lib.getElement(SF_MESS_FRAME_ID).contentWindow.location.hash;
    sfMessTimes ++;
    if (sfMessTimes > 50) {
    alert(sf_mess_msg.fail);
    sf_mess_lib.getElement(SF_MESS_SUBMIT_ID).disabled = false;
    for (var i = 0, l = sf_mess_cols.length; i < l; i++) {
    document.getElementById(SF_MESS_PREFIX + sf_mess_cols[i].idname).disabled = false;
    }
    } else {
    setTimeout(sfMessSubmitMonitor,100);
    }
        } catch (e) {
            sf_mess_lib.getElement(SF_MESS_FRAME_ID).src = "about:blank";
    alert(sf_mess_msg.success);
            sf_mess_lib.getElement(SF_MESS_SUBMIT_ID).disabled = false;
    for (var i = 0, l = sf_mess_cols.length; i < l; i++) {
    var inputCfg = sf_mess_cols[i];
    var inputEl = document.getElementById(SF_MESS_PREFIX + inputCfg.idname);
    inputEl.disabled = false;
    inputEl.value = filtInnertip(inputCfg.innertip);
    }
        }
    }function filtInnertip (str) {
    return str.replace(/&quot;/g, '"').replace(/&#039;/g, "'").replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, "&");
    }
    if (!window.is_sf_mess_loaded) {
    window.is_sf_mess_loaded = true;
    sf_mess_lib.loadCss(SF_MESS_THEME_PATH + sf_mess_cfg.theme + '/' + sf_mess_cfg.color + '/style.css');
    var sf_pos_style = "right:0";
    if (sf_mess_cfg.mbpos && sf_mess_cfg.mbpos.indexOf('L') == 0) {
    sf_pos_style = "left:0";
    }
    var sf_load_build = 'normal';
    if (sf_mess_cfg.theme == 'friendly') {
    sf_load_build = 'friendly';
    }
    document.write('<script type="text/javascript" src="' + SF_MESS_PATH + 'scripts/build' + sf_load_build + '.js"></script>');
    }