How to get the xpath by clicking an html element

How to get the xpath by clicking an html element

Quick Tip: Outline Elements on Hover

Quick Tip: Outline Elements on Hover

Highlight On Mouseover Effect With JQuery

Highlight On Mouseover Effect With JQuery I have seen this effect been used a lot on e-commerce sites or sites with lists in general. I don’t know how they do it exactly but I can show you how I would do it with JQuery. Take a look at the CSS class I made, what it does is it has a gold background color and round corners for Firefox, Safari and Chrome. .highlight-yellow { background-color:#FFD700; -moz-border-radius: 5px; -webkit-border-radius: 5px; } Let’s make the divisions we will highlighting.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ac lectus sem, at placerat tortor. Duis a justo non arcu interdum posuere. Suspendisse id lacinia felis. Cras pharetra, enim eu vestibulum imperdiet, dui ligula pretium est, eu blandit risus turpis gravida augue
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ac lectus sem, at placerat tortor. Duis a justo non arcu interdum posuere. Suspendisse id lacinia felis. Cras pharetra, enim eu vestibulum imperdiet, dui ligula pretium est, eu blandit risus turpis gravida augue
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus ac lectus sem, at placerat tortor. Duis a justo non arcu interdum posuere. Suspendisse id lacinia felis. Cras pharetra, enim eu vestibulum imperdiet, dui ligula pretium est, eu blandit risus turpis gravida augue

All I need now is to make a script that adds the CSS class we just made to the divisions when the mouse is on it, when the mouse moves out of the division I will remove the class. $(document).ready(function(){ $(".product").mouseover(function(){ $(this).addClass("highlight-yellow"); }); $(".product").mouseout(function(){ $(this).removeClass("highlight-yellow"); }); }); I don’t think I’ve told you about $(this) in any of my previous tutorials, in short, all $(this) does is refer to the current element on which the event (mouseout or mouseover) is been performed. As always, happy JQuerying!

jquery-plugin-biggerLink,highLight-层加亮_andy 阳光生活_百度空间

jquery-plugin-biggerLink,highLight-层加亮 yeah邮箱->jquery->jquery-biggerLink-层加亮 由jquery.biggerlink.js源码修改,剔除多个链接只能第一个链接和点击层起作用的功能,纯粹的加亮作用。 jquery.highLight.js 用法:        $('#links3 div').highLight(); js:         (function($) {             $.fn.highLight = function(options) {                 // Default settings                 var settings = {                     hoverclass:'hover', // class added to parent element on hover                     clickableclass:'hot', // class added to parent element with behaviour                            };                 if(options) {                     $.extend(settings, options);                 }                 $(this).addClass(settings.clickableclass).each(function(i){                        $(this)                     .mouseover(function(){                         $(this).addClass(settings.hoverclass);                     })                     .mouseout(function(){                         $(this).removeClass(settings.hoverclass);                     })                            });                 return this;             };         })(jQuery); 解决IE问题:                 (function($) {                     $.fn.highLight = function(options) {                         // Default settings                         var settings = {                             hoverclass:'hover', // class added to parent element on hover                             clickableclass:'hot', // class added to parent element with behaviour                             follow: true    // follow link? Set to false for js popups                         };                         if(options) {                             $.extend(settings, options);                         }                         $(this).filter(function(){                              return $('a',this).length > 0;                         }).addClass(settings.clickableclass).each(function(i){                             // Add title of first link with title to parent                             $(this).attr('title', $('a[title]:first',this).attr('title'));                             // hover and trigger contained anchor event on click                             $(this)                             .mouseover(function(){                                 window.status = $('a:first',this).attr('href');                                 $(this).addClass(settings.hoverclass);                             })                             .mouseout(function(){                                 window.status = '';                                 $(this).removeClass(settings.hoverclass);                             })                             // triggerable events on anchor itself                             .find('a').bind('focus',function(){                                 $(this).parents('.'+ settings.clickableclass).addClass(settings.hoverclass);                             }).bind('blur',function(){                                 $(this).parents('.'+ settings.clickableclass).removeClass(settings.hoverclass);                             }).end()                         });                         return this;                     };                 })(jQuery); css:         /* Put a border around the newly clickable element */         .hot {             border: solid 1px #ccc;             zoom: 1; /* Should be IE only */         }         /* rollover style for clickable element */         .hover {             border-color: #aaf;             cursor: pointer;             background-color: #cdF;         }         /* Simulate hover on contained link */         .hover a:link {             color: #CC3333;         }         .hover a:visited {             color: #CC3333;         } 附jquery.biggerlink.js         (function($) {             $.fn.biggerlink = function(options) {                 // Default settings                 var settings = {                     hoverclass:'hover', // class added to parent element on hover                     clickableclass:'hot', // class added to parent element with behaviour                     follow: true    // follow link? Set to false for js popups                 };                 if(options) {                     $.extend(settings, options);                 }                 $(this).filter(function(){                     return $('a',this).length > 0;                 }).addClass(settings.clickableclass).each(function(i){                                     // Add title of first link with title to parent                     $(this).attr('title', $('a[title]:first',this).attr('title'));                                         // hover and trigger contained anchor event on click                     $(this)                     .mouseover(function(){                         window.status = $('a:first',this).attr('href');                         $(this).addClass(settings.hoverclass);                     })                     .mouseout(function(){                         window.status = '';                         $(this).removeClass(settings.hoverclass);                     })                     .bind('click',function(){                         $(this).find('a:first').trigger('click');                     })                                         // triggerable events on anchor itself                                         .find('a').bind('focus',function(){                         $(this).parents('.'+ settings.clickableclass).addClass(settings.hoverclass);                     }).bind('blur',function(){                         $(this).parents('.'+ settings.clickableclass).removeClass(settings.hoverclass);                     }).end()                                         .find('a:first').bind('click',function(e){                         if(settings.follow == true)                         {                             window.location = this.href;                         }                         e.stopPropagation(); // stop event bubbling to parent                     }).end()                                         .find('a',this).not(':first').bind('click',function(){                         $(this).parents('.'+ settings.clickableclass).find('a:first').trigger('click');                         return false;                     });                 });                 return this;             };         })(jQuery);

jquery-plugin-biggerLink,highLight-层加亮_andy 阳光生活_百度空间的更多相关文章

  1. ollicle.com: Biggerlink – jQuery plugin

    ollicle.com: Biggerlink – jQuery plugin Biggerlink – jQuery plugin Purpose Demo Updated for jQuery 1 ...

  2. jquery制作弹出层带遮罩效果,点击阴影部分层消失

    jquery制作弹出层带遮罩效果,点击阴影部分层消失. 整体还是比较简单的. HTML代码很简单 <a href="#" class="big-link" ...

  3. The ultimate jQuery Plugin List(终极jQuery插件列表)

    下面的文章可能出自一位奥地利的作者,  列出很多jQuery的插件.类似的网站:http://jquerylist.com/原文地址: http://www.kollermedia.at/archiv ...

  4. JQuery plugin ---- simplePagination.js API

    CSS Themes "light-theme" "dark-theme" "compact-theme" How To Use Step ...

  5. jQuery plugin: Autocomplete 参数及实例

    官网:jQuery plugin: Autocomplete          (注:此插件已经不再更新.它的继任者是jQuery UI的一部分,) 此插件依赖于 jquery 1.2.6 --- j ...

  6. jQuery Dialog弹出层对话框插件

    Dialog.js的相关注释已经添加,可以按照注释,进行相关样式的修改,适用于自定义的各个系统! dialog.js /** * jQuery的Dialog插件. * * @param object ...

  7. Signs of a poorly written jQuery plugin 翻译 (Jquery插件开发注意事项,Jquey官方推荐)

    原文链接:http://remysharp.com/2010/06/03/signs-of-a-poorly-written-jquery-plugin/ 原文作者:remy sharp So far ...

  8. JQuery Plugin 1 - Simple Plugin

    1. How do you write a plugin in jQuery? You can extend the existing jQuery object by writing either ...

  9. jquery 简单弹出层(转)

    预定义html代码:没有 所有代码通过js生成和移除. 预定义css /* 基本弹出层样式 */ .my-popup-overlay { width:100%; height:auto; /* wid ...

随机推荐

  1. jQuery中的.live()与die()

    翻译原文地址:http://www.alfajango.com/blog/exploring-jquery-live-and-die/ 很多开发者都知道jQuery的.live()方法,他们大部分知道 ...

  2. Android Studio Module疑问

    ERROR: APK path is not specified for module From your existing project, go to 'File' -> 'Project ...

  3. boa,thttp服务器安装,配置,测试

    boa 1, SERVER_ROOT自定义,define.h头文件中,默认“/etc/boa" 2,./configure 3,修改CC,默认CC=gcc,make 4,error util ...

  4. Linux下安装QT和OpenGL后QT无法使用OpenGL的解决方法

    我的系统为Ubuntu14.04,用apt-get安装了实现了OpenGl的mesa,QT则是用官网下载的run文件来安装的. 好了,现在两个都分别有了,所以要在qt下尝试写OpenGl代码. 之前试 ...

  5. vim note

    2016-1-22 vim plugin collections: (参考 https://www.youtube.com/watch?v=0QFR-_wUoA0) vim-pathogen  插件管 ...

  6. Task和backStack(本篇章核心)

     对Task和backStack的认识过程 1.由demo测试得到的关系图: 1.一个task中可以有多个app的Activity, 由于一个app可以对应一个或多个process, 2.所以一个ta ...

  7. NET Core 的 Views

    NET Core 十种方式扩展你的 Views 原文地址:http://asp.net-hacker.rocks/2016/02/18/extending-razor-views.html作者:Jür ...

  8. [原]CAS和Shiro在spring中集成

    shiro是权限管理框架,现在已经会利用它如何控制权限.为了能够为多个系统提供统一认证入口,又研究了单点登录框架cas.因为二者都会涉及到对session的管理,所以需要进行集成. Shiro在1.2 ...

  9. 柯南君:看大数据时代下的IT架构(7)消息队列之RabbitMQ--案例(routing 起航)

    二.Routing(路由) (using the Java client) 在前面的学习中,构建了一个简单的日志记录系统,能够广播所有的日志给多个接收者,在该部分学习中,将添加一个新的特点,就是可以只 ...

  10. mongodb remove删除文档的用法

    在看<mongoDB权威指南>中,在删除文档时,出现问题: 书中介绍:采用db.foo.remove()命令则可以删除foo集合中所有的文档,但是在执行该命令时,shell客户端却报错. ...