蝙蝠岛资源网 Design By www.hbtsch.com
这里说明下,这样的效果发过类似的效果。具体的可以到脚本下载中心查找。

效果图:

jquery 模拟雅虎首页的点击对话框效果

 

声明:我做的只是实现这个效果,在美观上并没有做到yahoo主页这么好看,所以不要介意!

原材料:

 jquery 模拟雅虎首页的点击对话框效果

    jquery 模拟雅虎首页的点击对话框效果

    jquery 模拟雅虎首页的点击对话框效果

思路:

1:为每一个li标签添加悬浮事件

2:构建iframe并获取到当前li标签下的a元素的href属性值

3:构建DIV包含iframe元素并显示
HTML结构:
复制代码 代码如下:
<ul>
<Li><a href="http://www.google.cn">新闻</a></Li>
<li><a href="http://www.163.com">体育</a></li>
<li><a href="http://www.sina.com">娱乐</a></li>
</ul>

CSS样式:
复制代码 代码如下:
ul{
float:left;
}
ul li{
display:block;
margin-top:15px;
width:100px;
position:relative;
}
a{
text-decoration:none;
color:#8000ff;
}
.show{
width:640px;
height:506px;
position:absolute;
top:-45px;
left:30px;
background:url(1.gif) no-repeat;
padding:45px 20px 35px 40px;
}
.close{
width:22px;
height:22px;
float:right;
display:block;
margin-top:-30px;
background:url(2.gif) no-repeat;
}
.quick{
position:absolute;
top:0px;
left:30px;
background:url(3.jpg) no-repeat;
width:37px;
height:26px;
font-size:12px;
color:white;
line-height:26px;
text-align:center;
}

JS代码:
复制代码 代码如下:
$(document).ready(function(){
$('ul li a').hover(function(e){
var quickw=$(this).parent().parent().find('#clickdiv');
if(quickw){
$('#clickdiv').remove();
}
$(this).parent().append('<div id="clickdiv">预览</div>');
$('#clickdiv').addClass('quick');
$("#clickdiv").click(function(){
$(this).css('display','none');
var url=$(this).parent().find('a').attr('href');
var $basediv=$(this).parent().parent().find('#window');
if($basediv){
$('#window').remove();
$(this).parent()
.append("<div id='window'><div id='closebutton'><a href='#'></a></div><iframe frameborder='0' hspace='0' src='"+url+"' style='width:640px;height:506px;'></iframe></div>")
.fadeIn('slow');
$("ul li #window").addClass('show');
$('#closebutton a').addClass('close');
$('#closebutton a').click(function(){
$("ul li #window").remove();
});
}
});

标签:
雅虎,对话框

蝙蝠岛资源网 Design By www.hbtsch.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
蝙蝠岛资源网 Design By www.hbtsch.com

评论“jquery 模拟雅虎首页的点击对话框效果”

暂无jquery 模拟雅虎首页的点击对话框效果的评论...

稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!

昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。

这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。

而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?