点击文字,div在网页顶部下拉显示的效果 日本鬼子的网站:www.tripleships.com顶部右上角有个“contact us”,一点击,会出现下拉的div区域这样的效果,是什么思路?要用到哪些东西呢?求助 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 呃 就是在最上面也放一个DIV 点击contact us的时候就显示 再次点击就隐藏,然后有一点缓动效果。要用到的就是div的隐藏,例:---------------------------<style>#a{ display:none;//设置默认隐藏 width:100px; height:100px;}#b{ width:100px; height:100px;}</style><script>var displayBar=true;function switchBar(obj){ if (displayBar) { document.getElementById('a').style.display ="block"; displayBar=false; } else{ document.getElementById('a').style.display ="none"; displayBar=true; }}</script><body><div id="a">111111</div><div id="b"><a href="#" onclick="switchBar(this)">按钮</a></div></body>=================================ie8测试通过 <body> <div id="ceng" style="background-color: Red; width: 300px; height: 200px; display: none;"> sss</div> <span id="wenzi">contact us</span></body></html><script> $(function () { $("#wenzi").bind("click", function () { $("#ceng").slideDown("slow"); }); })</script> 那只是jquery里面的一个特效,没什么难度,jquery里面已经封装好了,还是跟楼主写完整,方便运行<body> <div id="ceng" style="background-color: Red; width: 300px; height: 200px; display: none;"> sss</div> <span id="wenzi" style="cursor: pointer;">contact us</span></body></html><script> $(function () { //绑定文字的点击事件 $("#wenzi").bind("click", function () { //判断层是显示,还是隐藏,如果隐藏 if (document.getElementById('ceng').style.display == "none") { //显示 $("#ceng").slideDown("slow"); } else { //隐藏 $("#ceng").slideUp("slow"); } }); })</script> apply()方法的疑问 怎么在页面上设置ckfinder浏览和上传路径? onbeforeunload事件 如何只监听指定事件 求助!!JavaScript中产生的服务器会话问题 html无法加载js文件,以前可以不知道为啥不行了,急!!!!!!!!!! 谁能提供一个漂亮的气泡提示框特效 这样在XSL里怎样写? 服务器与本地显示结果不一样是什么原因 表格中某一tr的分行行尾处理 Base64转png图片 一个关于动态设置td的高度和宽度的问题。 JavaScript的正则,$X解释下?
要用到的就是div的隐藏,例:
---------------------------
<style>
#a{
display:none;//设置默认隐藏
width:100px;
height:100px;
}
#b{
width:100px;
height:100px;
}
</style><script>
var displayBar=true;
function switchBar(obj){
if (displayBar)
{
document.getElementById('a').style.display ="block";
displayBar=false;
}
else{
document.getElementById('a').style.display ="none";
displayBar=true;
}
}
</script><body>
<div id="a">111111</div>
<div id="b"><a href="#" onclick="switchBar(this)">按钮</a></div>
</body>
=================================
ie8测试通过
<div id="ceng" style="background-color: Red; width: 300px; height: 200px; display: none;">
sss</div>
<span id="wenzi">contact us</span>
</body>
</html>
<script>
$(function () {
$("#wenzi").bind("click", function () {
$("#ceng").slideDown("slow");
});
})
</script>
<body>
<div id="ceng" style="background-color: Red; width: 300px; height: 200px; display: none;">
sss</div>
<span id="wenzi" style="cursor: pointer;">contact us</span>
</body>
</html>
<script>
$(function () {
//绑定文字的点击事件
$("#wenzi").bind("click", function () {
//判断层是显示,还是隐藏,如果隐藏
if (document.getElementById('ceng').style.display == "none") {
//显示
$("#ceng").slideDown("slow");
}
else {
//隐藏
$("#ceng").slideUp("slow");
}
});
})
</script>