2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > jquery 模拟雅虎首页的点击对话框效果【jquery】

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

时间:2019-06-13 06:09:35

相关推荐

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

web前端|js教程

雅虎,对话框

web前端-js教程

这里说明下,这样的效果脚本之家发过类似的效果。具体的可以到脚本下载中心查找。

动态字源码,vscode终端字体调大,ubuntu 替换原,tomcat 是哪家的,selenium 爬虫案例,php dio扩展安装,seo推广有哪些费用优化,有什么卖qq号的网站源码,zencart 邮件模板修改lzw

效果图:

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

原材料:

思路:

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

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

3:构建DIV包含iframe元素并显示

HTML结构:

qq靓号网站源码,vscode字体斜体,手机ubuntu声音,苹果idea tomcat,sqlite dll 函数,虚拟服务器免费空间,超级活动插件,前端框架vue的好处,动态页面 爬虫,万能的php,百度seo百度,游戏私服源码网站,uur网页界面集成框架,网站侧边栏模板,jquery移除页面元素,jsp的管理系统,直播开源程序下载官网lzw

新闻

体育

娱乐

CSS样式:

多用户自媒体平台源码,Ubuntu升级为root,爬虫时出现none,手机 php error,品牌口碑seolzw

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.jpg) no-repeat;

padding:45px 20px 35px 40px;

}

.close{

width:22px;

height:22px;

float:right;

display:block;

margin-top:-30px;

background:url(2.jpg) 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(

预览‘);

$(‘#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(“

“)

.fadeIn(‘slow’);

$(“ul li #window”).addClass(‘show’);

$(‘#closebutton a’).addClass(‘close’);

$(‘#closebutton a’).click(function(){

$(“ul li #window”).remove();

});

}

});

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。