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. zabbix监控服务器部署

    1.服务器安装lamp环境 [root@monitor ~]# yum  install gcc gcc-c++ autoconf httpd php mysql mysql-server php-m ...

  2. 【JQ成长笔记】jQuery Validate验证插件

    validate是一款很好的jq插件,提供了强大的验证功能,让客户端表单验证变得更简单,同时提供了大量的定制选项,满足应用程序各种需求.该插件捆绑了一套有用的验证方法,包括 URL 和电子邮件验证,同 ...

  3. PHP fopen和fwrite函数实现创建html页面

    思路 用fopen函数和fread函数得到模板,然后用str_replace函数替换模板标签为变量,最后用fwrite函数输出新的HTML页面 index.html模板页面 <!DOCTYPE ...

  4. acdream 1157Segments cdq分治

    题目链接 #include <iostream> #include <vector> #include <cstdio> #include <cstring& ...

  5. python 文本编辑基础记录

    不熟悉编码方式,同时python的编码方式折磨我了很长时间,记录下,以免忘记,本文内容存在错误,是自己理解,看到仅当参考 Unicode 是字符集,有点像一本字典,utf-8是在unicode这本字典 ...

  6. 添加EF上下文对象,添加接口、实现类以及无处不在的依赖注入(DI)

    添加EF上下文对象,添加接口.实现类以及无处不在的依赖注入(DI) 目录索引 [无私分享:ASP.NET CORE 项目实战]目录索引 简介 上一章,我们介绍了安装和新建控制器.视图,这一章我们来创建 ...

  7. RMA编码为必输

    应用 Oracle Inventory 层 Level Function 函数名 Funcgtion Name RCV_RCVTXERE 表单名 Form Name RCVTXERE 说明 Descr ...

  8. Linux彩色输出

    在linux下,可以使用一些宏,加上自定义格式输出,让输出更易于调试: 排版出来可能有些乱,注意do{ }while(0);是在一行里就可以了. #include <stdio.h> #i ...

  9. Qt信号槽机制的实现(面试的感悟,猜测每一个类保存的一个信号和槽的二维表,实际使用函数指针 元对象 还有类型安全的检查设定等等)

    因为面试时问了我这道题,导致我想去了解信号槽到底是如何实现的,于是贴着顺序看了下源码,大致了解了整个框架.网上关于信号槽的文章也很多,但是大部分都是将如何应用的,这里我就写一下我所理解的如何实现吧, ...

  10. rsyslog 配置详解

    格式:: 日志设备(类型).(连接符号)日志级别 日志处理方式(action) 日志设备(可以理解为日志类型): ------------------------ auth –pam产生的日志 aut ...