在网上学习了如何在wordpress博客里面使链接平移的特效,现分享下代码!!!

首先要确保已经加载文章开关所说的JQuery库。
1、在所用主题的 style.css 文件里添加一句(这是全站链接应用,如果只想部分链接应用,于其前面加入其它控制符):

  1. a{position:relative;}

2、在主题所调用的 .js文件里也就是上一个效果里说到的 .js文件里加入:

  1. jQuery(document).ready(function($){
  2. $('a').hover(function() {
  3. $(this).stop().animate({'left': '5px'}, 'fast');
  4. }, function() {
  5. $(this).stop().animate({'left': '0px'}, 'fast');
  6. });
  7. });
 

相关文章:

  • 2021-07-07
  • 2021-10-18
  • 2021-09-16
  • 2022-02-08
  • 2021-09-28
  • 2022-02-18
  • 2022-02-23
  • 2022-02-05
猜你喜欢
  • 2022-02-26
  • 2022-01-01
  • 2022-01-25
  • 2021-05-28
  • 2021-08-18
  • 2022-03-06
  • 2021-07-07
相关资源
相似解决方案