慢慢显示出来的 Chatbox

这个就是有一个图片在旁边,然后点击了那张图片就会慢慢显示在中间的哦



先到-->设计-->页面元素-->添加小工具--> Html/Jave Script 把以下的代码放下去
<div style='display:scroll; position:fixed; top:70px; right:-0px;'>
<!-- Start Ajax Popup Cbox by -->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<script>
$(document).ready(function() {
//select all the a tag with name equal to modal
$('a[name=modal]').click(function(e) {
//Cancel the link behavior
e.preventDefault();
//Get the A tag
var id = $(this).attr('href');
//Get the screen height and width
var maskHeight = $(document).height();
var maskWidth = $(window).width();
//Set heigth and width to mask to fill up the whole screen
$('#mask').css({'width':maskWidth,'height':maskHeight});
//Get the window height and width
var winH = $(window).height();
var winW = $(window).width();
//Set the popup window to center
$(id).css('top', winH/2-$(id).height()/2);
$(id).css('left', winW/2-$(id).width()/2);
//transition effect
$(id).fadeIn(2000);
});
//if close button is clicked
$('.window .close').click(function (e) {
//Cancel the link behavior
e.preventDefault();
$('#mask').hide();
$('.window').hide();
});


//if mask is clicked
$('#mask').click(function () {
$(this).hide();
$('.window').hide();
});
});
</script>
<style>
img: { border: none; }
#mask {
position:center;
left:0;
top:0;
z-index:9000;
background-color:#000;
display:none;
}
#boxes .window {
position:fixed;
left:0;
top:0;
width:230px;
height:450px;
display:none;
z-index:9999;
padding:20px;
}


#boxes #(你的Cbox账号名字)Cbox {repeat 0 0 white;
width:230px;
height:455px;
padding:20px 0 10px 10px;
}
#closesb {
padding:2px 0 0 0;
}


#author {
padding:8px 0 0 160px;
}
</style>
<ul><center> <a href="#(你的Cbox账号名字)Cbox" name="modal"><img src="(图片URL)" border="0" /></a> </center> </ul>
<div id="boxes">
<!-- Start Cbox -->
<div id="(你的Cbox账号名字)Cbox" class="window">
<!-- Begin Cbox - http://www.cbox.com/ --><center>
(Cbox代码)
<div id="author">
</div><div id="closesb"><center><input type="button" value="Close" class="close" /><center>
</center></center></div></center></div><!-- End of Ajax Cbox -->
<!-- Mask to cover the whole screen -->
<div id="mask"></div>
<!-- End of Ajax Popup Cbox--></div></div>
温馨小提示❤
你的Cbox账号名字-->就是每次当你要登录 Cbox 的时候所用的名字
图片URL-->旁边图片的 URL
Cbox代码-->就是你的 Cbox 的整个代码哦

Cbox 账号的例子:
好了就按保存就完成了

没有评论:

发表评论

留言规则 请勿犯规 :)

--------------------------------------------------------------------------------

1、由于评论太哆,有些我不能一一评论

2、如有捣乱着,恕我删除留言

3、有些博友要的教程,请勿再三询问,请到教程列表里仔细寻找

谢谢 :)