jQuery滑过头像图片展示个人信息效果
来源:互联网 发布:java api 1.8英文版 编辑:程序博客网 时间:2024/05/16 07:37
这是一款经典的jQuery图片插件,同时,也可以是一款jQuery提示框插件。这款jQuery插件的功能是当你把鼠标滑过头像图片缩略图时,即可弹出头像对应用户的详细个人信息,弹出的标签虽然不大,但是还是能容纳很多个人信息的。
var Album = (function($){ function album(o){ this.int(o) }; album.prototype = { int: function(o){ var that = this; this.aImg = $(o).find('img'); this._css = null; this.iLoad = 0; this.zoom = 1.5; this.i=0; this.ok = false; this.aEm = $('em',$(o)); this.tLayer = null; this.aImg.each(function(){ $(this).load(function(){ that.iLoad++; if(that.iLoad==that.aImg.length&&!that.ok){ that.pos(o); } }) }); setTimeout(function(){ if(!that.ok){that.pos(o);} },2000); }, pos:function(o){ var that = this; that.ok = true; $('a',$(o)).each(function(){ var oP = $(this).parent(); var oS = $(this).siblings('.Album_info'); oP.css({'width':$('img',this).width(),'height':$('img',this).height()}) $(this).css({'top':oP.position().top,'left':oP.position().left}); $('em',this).css({'height':oP.height(),'filter': 'alpha(opacity=50)'}); if($(o).width()-oP.position().left>=$(this).width()*6){ oS.css({'height':Math.round($(this).height()*that.zoom)+4,'left':oP.position().left-2,'right':'auto','padding-left':Math.round($(this).width()*that.zoom)}) }else{ oS.css({'height':$(this).height()*that.zoom+4,'right':$(o).width()-oP.position().left-$(this).width()-2,'left':'auto','padding-right':Math.round($(this).width()*that.zoom),'text-align':'right'}) } if(oP.position().top>=Math.round($(this).height()*(that.zoom-1)/2)&&$(o).height()-oP.position().top-$(this).height()>=Math.round($(this).height()*(that.zoom-1)/2)){ oS.css('top',oP.position().top-Math.round($(this).height()*(that.zoom-1)/2)-2) }else if(oP.position().top<Math.round($(this).height()*(that.zoom-1)/2)){ oS.css('top',$(this).parent().position().top-2) }else{ oS.css('top',$(this).parent().position().top-Math.round($(this).height()*(that.zoom-1)+2)) } }); this.showImg(o) }, showImg: function(o){ var that = this; $('li',$(o)).each(function(){ $('a',this).css({'visibility':'visible','display':'none'}).fadeIn(1000); }) setTimeout(function(){ $(o).css({'background':'none'}); that.hover(o); },1000) }, hover: function(o){ var that = this; $('a',$(o)).hover(function(){ var oP = $(this).parent(); var oS = $(this).siblings('.Album_info'); $('em',this).hide(); if(that.tLayer){clearTimeout(that.tLayer);that.tLayer = null} that.aEm.not($('em',this)).each(function(){ if(!$(this).is(':visible')){ $(this).fadeIn(200) } }); oS.show().animate({width:$(this).width()*6-Math.round($(this).width()*that.zoom)+7},300); that._css = {'top':oP.position().top,'z-index':$(this).css('z-index'),'width':$(this).width(),'height':$(this).height(),'left':$(this).css('left'),'right':$(this).css('right')}; if($(o).width()-oP.position().left>=$(this).width()*6){ $(this).css({'right':'auto','left':parseInt(oS.css('left'))+2}) }else{ $(this).css({'right':parseInt(oS.css('right'))+2,'left':'auto'}) } $(this).css({'top':parseInt(oS.css('top'))+2,'width':$(this).width()*that.zoom,'height':$(this).height()*that.zoom,'z-index':$(this).css('z-index')+100}) $(this).children('img').css({'width':$(this).width(),'height':$(this).height()}) },function(){ $('.Album_info').hide().css({'width':'auto'}).stop(); $(this).css(that._css); $(this).children('img').css({'width':that._css.width,'height':that._css.height}) that.tLayer = setTimeout(function(){ that.aEm.fadeOut(200) },200) }) } } return { set: function(o){ new album(o) } }})(jQuery)
0 0
- jQuery滑过头像图片展示个人信息效果
- jQuery鼠标滑过展示层效果
- 使用jQuery实现滑过图片展示信息效果
- jQuery:图片展示效果
- Jquery 某效果展示
- jQuery实现展示效果
- js模拟鼠标滑过展示title效果
- XMPP个人信息展示
- jQuery实例:图片展示效果
- jQuery实例:图片展示效果
- jQuery实例:图片展示效果
- jQuery实例:图片展示效果
- jQuery实例:图片展示效果
- jQuery数字滚动展示效果
- jquery实现视频展示效果
- 自定义控件InfoTextView展示个人信息
- jQuery实现鼠标滑过延时显示的效果
- css+jquery鼠标滑过,显示下拉菜单效果
- 一招制敌 - 玩转 AngularJS 指令的 Scope (作用域)
- HDU 1722 Cake(思维题)
- VC枚举配置文件的Section存入Map
- 欢迎使用CSDN-markdown编辑器
- 写论文注意事项
- jQuery滑过头像图片展示个人信息效果
- android.app.Activity.startActivity(Intent intent)
- C++ 语法
- Spring:加载外部properties文件
- JS实现下拉列表联动
- 百度地图SDK导航功能初始化错误
- homerHEVC代码阅读(28)——mem_transfer_move_curr_ctu_group、mem_transfer_intra_refs
- wget 编译出错解决mips
- The POM for com.sitech.prm.cloud:javaCloudDcpFramework:jar:2.2.0-SNAPSHOT is missing&&Tomcat安装