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. centos安装中文支持(转)

    安装中文支持包. yum install fonts-chineseyum install fonts-ISO8859-2 -------- 一.安装中文支持方法1.在安装光盘中找到一下包进行安装.r ...

  2. Linux软连接与硬连接 .

    http://blog.csdn.net/ningxinghai/article/details/7342338 Linux的软连接相当于window系统的快捷方式,如我们桌面的QQ等. 硬连接相当于 ...

  3. struts2中使用ognl表达式时各种符号的使用规则$,#,%

    OGNL表达式struts2标签“%,#,$” 一.什么是OGNL,有什么特点? OGNL(Object-Graph Navigation Language),大概可以理解为:对象图形化导航语言.是一 ...

  4. Linux中的那些英文缩写和她的含义们

    系统 man: Manual 意思是手册,可以用这个命令查询其他命令的用法. pwd:Print working directory 打印工作路径. su:Swith user 切换用户,切换到roo ...

  5. Werkzeug源码阅读笔记(四)

    今天主要讲一下werkzeug中的routing模块.这个模块是werkzeug中的重点模块,Flask中的路由相关的操作使用的都是这个模块 routing模块的用法 在讲解模块的源码之前,先讲讲这个 ...

  6. C++中的引用到底是什么

    这也算是一个老生常谈的问题,写这个其实就是想趁着暑假把博客丰富一下. 咱随便在谷哥.度娘.病软引擎上搜搜都可以得到各种关于引用的解释,无非就是"引用不同于指针,引用是一个变量的别名" ...

  7. SQL Server 修改表

    alter table 可能用三种方式来完成. 第一种: 只修改元数据. 1.删除一个列. 2.一个行被增加而且空值被认为是所有行的新值. 3.当可变长度的列的长度增加时. 4.不允许为空的列被允许为 ...

  8. Unix/Linux环境C编程入门教程(9) unbntu CCPP开发环境搭建

    1.      首先启动VMware,如果没有安装,请查看前面VMware的安装视频 2 启动虚拟机向导,选择自定义 3 单击下一步 4 选择稍后安装操作系统 5 .选择unbntu 64linux ...

  9. opensatck 在启动的时候注入额外的信息

    在配置ceph的时候建议使用metadata/cloud-init来注入额外的信息. https://raymii.org/s/tutorials/Automating_Openstack_with_ ...

  10. i美股投资研报--Michael Kors(IPO版) _Michael Kors(KORS) _i美股

    i美股投资研报--Michael Kors(IPO版) _Michael Kors(KORS) _i美股 i美股投资研报--Michael Kors(IPO版)