在博客园添加Web Live Messenger对话框

学习赵老师的,在自己博客中添加Web Live Messenger对话框

http://www.cnblogs.com/JeffreyZhao/archive/2007/11/10/Add-Web-Live-Messenger-to-your-page.html

在博客园的选项->常用选项->页脚Html代码添加以下代码

 

ContractedBlock.gif ExpandedBlockStart.gif Code
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
 <script src="http://files.cnblogs.com/liuke209/lk.js" language="JavaScript" type="text/javascript"></script>
 <div id="liveMessengerContainer" style="position:absolute;">
        
<div style="border: solid 1px black; 
             width:160;
             height: 39px; cursor:pointer;
             background-image: url(http://images.cnblogs.com/cnblogs_com/liuke209/Messenger_Header_bg.gif)
"
             id
="liveMessengerThumb">
            
<img src="http://images.cnblogs.com/cnblogs_com/liuke209/Messenger_logo_beta.gif" 
                 alt
="使用Live Messenger联系我"  
                 style
="margin: 10px 10px 0px 9px;"/>
        </div>
        <table border="0" cellpadding="0" cellspacing="0" id="liveMessengerPanel">
            
<tr>
                
<td valign="top">
                    
<img id="hideLiveMessengerPanel"
                         style
="cursor:pointer; margin-right: 3px;"
                         src
="http://images.cnblogs.com/cnblogs_com/liuke209/Messenger_close_sm.gif" 
                         alt
="关闭" />
                </td>
                <td id="msnFrame">
                
</td>
            </tr>
        </table>
    </div>
    <script language="javascript" type="text/javascript">
        
function getClientBounds()
        {
            
var clientWidth;
            
var clientHeight;
            
            
if ($.browser.msie)
            {
                clientWidth 
= document.body.clientWidth;
                clientHeight 
= document.body.clientHeight;
            }
            
else if ($.browser.safari)
            {
                clientWidth 
= window.innerWidth;
                clientHeight 
= window.innerHeight;
            }
            
else if ($.browser.opera)
            {
                clientWidth 
= Math.min(window.innerWidth,document.body.clientWidth);
                clientHeight 
= Math.min(window.innerHeight,document.body.clientHeight);
            }
            
else
            {
                clientWidth 
= Math.min(window.innerWidth,document.documentElement.clientWidth);
                clientHeight 
= Math.min(window.innerHeight,document.documentElement.clientHeight);
            }
     
            
return { width : clientWidth, height : clientHeight };
        }
     
        
function resetLiveMessengerPosition()
        {
            
var clientBounds = getClientBounds();
            
var container = document.getElementById("liveMessengerContainer");
            
            
var scrollLeft = document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;
            
var scrollTop = document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;
                    
            
var containerLeft=scrollLeft+clientBounds.width-container.clientWidth-5;
            
var containerTop=scrollTop+clientBounds.height-container.clientHeight;
                    
            $(
"#liveMessengerContainer").css({top : containerTop + "px", left : containerLeft + "px"});
        }
    
</script>

    
<script language="javascript" type="text/javascript">    
    $(
"#liveMessengerPanel").hide();

    $(document).ready(
function(){

        CreatIframe().appendTo(
"#msnFrame");

        $(window).scroll(resetLiveMessengerPosition);
        $(window).resize(resetLiveMessengerPosition);
    
        resetLiveMessengerPosition();
        
        $(
"#liveMessengerThumb").click(function(){
            $(
"#liveMessengerThumb").fadeOut(500function(){
                $(
"#liveMessengerPanel").fadeIn(500function(){
                    resetLiveMessengerPosition();
                });
                resetLiveMessengerPosition();
            });
        });
        
        $(
"#hideLiveMessengerPanel").click(function(){
            $(
"#liveMessengerPanel").fadeOut(500function(){
                $(
"#liveMessengerThumb").fadeIn(500function(){
                    resetLiveMessengerPosition();
                });
                resetLiveMessengerPosition();
            });
        });
    });
    
</script>

 由于博客园过滤了iframe,我们需要自己创建一个.js文件,用于动态创建jframe

http://settings.messenger.live.com/Applications/CreateHtml.aspx

点击它创建自己的Msn对话框

创建 HTML->即时消息窗口->复制 HTML 并将其粘贴到您的网页上

将生一段jframe代码,将这段代码复制到.js中,用于动态生成

转载于:https://www.cnblogs.com/liuke209/archive/2009/06/24/1510496.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值