function overIt(){var the_obj = event.srcElement;if(the_obj.tagName.toLowerCase() == "td"){the_obj=the_obj.parentElement;the_obj.oBgc=the_obj.currentStyle.backgroundColor; the_obj.oFc=the_obj.currentStyle.color;the_obj.style.backgroundColor='red';the_obj.style.color='blue';the_obj.style.textDecoration='underline';} }function outIt(){var the_obj = event.srcElement;if(the_obj.tagName.toLo...
第一个太简单就不说了,第二个也很简单,但每个人都有不同的实现方法,下面给一个比较简洁的做法,支持IE6、IE7、FF2,其他浏览器未测试(可以扩展一下用到ASP.NET的GridView里): 鼠标划过表格行变色-简洁实现 #tb{width:666px;border-collapse:collapse;border:1px solid #EEE;font-size:14px;} #tb th{background:#EEE;border-bottom:1px solid #CCC;padding:4px;} #tb td{border:1px solid #EEE;padding:4px;} 商品名称 单...
上次帮朋友写过的一个简单切换效果,超级简单,但也比较适用.因为用到了CSS Sprite技术,DEMO中附带了IE6兼容png的JS. 核心JavaScript代码:点此查看DEMO 代码如下: //@Mr.Think获取对象属性兼容方法 function $(objectId) { if(document.getElementById && document.getElementById(objectId)) { return document.getElementById(objectId);// W3C DOM } else if (document.all && document.all(objectId)) { return document.all(ob...
花了点时间,封装成了一个类(附带一个添加样式的类),适合初学者,直接调用函数即可,无需改代码. 核心JavaScript代码: 奇或偶数行高亮显示及鼠标划过高亮显示类~@Mr.Think body{font-size:0.8em;letter-spacing:1px;font-family:"微软雅黑"; line-height:1.8em} h1{font-size:1em; font-weight:normal;} h1 a{background:#CFF; padding:2px 3px; text-decoration:none;} h1 a:hover{background:#eee; text-decoration:underline} ...
隔行变色且鼠标划过变色的效果 .container ul{margin:0;padding:0;} .container li{cursor:pointer;height:30px;width:200px;background-color:#FFC;line-height:30px;text-indent:1em;font-size:12px;} .container .change{cursor:pointer;height:30px;width:200px;background-color:#C1F9CC;line-height:30px;text-indent:1em;font-size:12px;} .container .current{cursor:pointer;height:30px;width:200px;background-color...
代码如下: +Follow 这是隐藏层 css: 代码如下: .layer_follow { display:none } js: 代码如下: var isPlusMobileVisible=false; var showTid; var hideTid; function showPlusMobile(){ if(isPlusMobileVisible == false) { showTid = setTimeout("document.getElementById(layer_follow).style.display=block; isPlusMobileVisible=true;", 500); }else{ clearTimeout(hideTid); } } function hidePlusMobile(){ if(isPlu...
/*栏目切换样式开始*/.none {display: none;}.block {display: block;}/*头部样式*/.s_c {width:800px;text-align: center;}.s_c ul{clear:both;margin:0;}.s_c li{list-style:none;float:left;position: relative;width: 70px;}/**/.c_0 {background-color: #CCCCCC;} /*隐藏状态*/.c_1 {background-color: #0000CC;} /*显示状态*//**/.s_b{ border:1px solid #666;height: 160px;width: 440px;} /**//*栏目切换样式结束*/ functi...
本文实例讲述了jQuery实现鼠标划过展示大图的方法。分享给大家供大家参考。具体如下: 这里用css和jquery实现鼠标移上元素时大图展示,并且大图不能溢出整个div框代码如下:jQuery鼠标划过展示大图* { margin:0; padding:0; } body { font:12px/1.5 tahoma, arial, simsun; } .wrap { position:relative; margin:0 auto; width:319px; height:243px; } table { border-collapse:collapse; border-spacing:0; } td { border:1px soli...
本文实例讲述了jQuery实现鼠标划过修改样式的方法。分享给大家供大家参考。具体如下:$(document).ready(function () {//默认情况下样式$("input:text").attr("style","border:1px solid #7E9DB9;");//鼠标移入样式$("input:text").mouseover(function () {$(this).attr("style","border:1px solid #EDBB72;");});//鼠标移开样式$("input:text").mouseout(function () {$(this).attr("style","border:1px solid #7E9DB9;");}); });...
本文实例讲述了js实现鼠标划过给div加透明度的方法。分享给大家供大家参考。具体实现方法如下:#div2 a img{ filter:alpha(opacity=100)} #div2 a:hover img{ filter:alpha(opacity=70)} ');} if ((navigator.appName.indexOf('Netscape')+1)) { document.write(' #div2 a img{opacity: 1;} #div2 a:hover img{opacity: 0.7;}'); } else { document.write(''); } // End 希望本文所述对大家的javascript程序设计有所帮助。
本文实例讲述了JS+DIV实现鼠标划过切换层效果的方法。分享给大家供大家参考。具体实现方法如下:DIV层切换/********************************************* 功能: 通用DIV切换函数 参数: divID --当前DIV的ID号;divName--要改变的这一组DIV的命名前缀;zDivCount --这一组DIV的个数-1 BY : JetKing 2007.06 *********************************************/ function ChangeDiv(divId,divName,zDivCount) { for(i=0;i 层切换...
本文实例讲述了jQuery实现鼠标划过添加和删除class的方法。分享给大家供大家参考。具体实现方法如下:$('#elm').hover(function(){$(this).addClass('hover')},function(){$(this).removeClass('hover')} )希望本文所述对大家的jQuery程序设计有所帮助。
鼠标事件进行监听 需求中,在一个table(组件)表中,对于其中一列(该列为图片列),当鼠标划过该列的某个单元格子(图片)时,需要展示出该单元格子对应的遮罩层 翻阅了一些博客,发现好多都提到了mouse事件,如mouseover、mouseout、mouseenter、mouseleave,在之后我自己也通过这种方法进行了尝试。 <template><el-table:data="tableData"stripestyle="width: 100%"><el-table-columnprop="pic"label="图片"width="180"><templ...
本文实例讲述了jQuery实现鼠标划过添加和删除class的方法。分享给大家供大家参考。具体实现方法如下: $(#elm).hover(function(){$(this).addClass(hover)},function(){$(this).removeClass(hover)} )希望本文所述对大家的jQuery程序设计有所帮助。
本文实例讲述了js实现鼠标划过给div加透明度的方法。分享给大家供大家参考。具体实现方法如下: <script language="javascript"> <!-- Begin if ((navigator.appName.indexOf(Microsoft)+1)) { document.write(<style type="text/css"> #div2 a img{ filter:alpha(opacity=100)} #div2 a:hover img{ filter:alpha(opacity=70)} </style>);} if ((navigator.appName.indexOf(Netscape)+1)) { document.write(<style type="text/css"...