利用jquery实现图片显隐特效

作者:matrix 被围观: 2,347 次 发布时间:2011-08-05 分类:Wordpress 兼容并蓄 | 2 条评论 »

这是一个创建于 4647 天前的主题,其中的信息可能已经有所发展或是发生改变。

小站有个图片显隐效果是利用jquery做出来的.

利用jquery可以做很多特效:滑动菜单、图片幻灯...

首先需要在header.php中加载jquery,可以使用外链也可以内链。

外链可以利用google为我们提供的JS库,据说可以提高js加载速度,格式如下:

<script type="text/javascript" src="//jqueryjs.googlecode.com/files/jquery-1.2.3.min.js"></script>

内链格式为:

<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.min.js" ></script>

然后再在header.php中添加即可:

<script type="text/javascript">
$(function () {
$('img').hover(
function() {$(this).fadeTo("fast", 0.5);},
function() {$(this).fadeTo("fast", 1);
});
});
</script>

来自:http://zmingcx.com/using-jquery-to-achieve-picture-was-hidden-effects.html

其他文章:
本文固定链接:https://www.hhtjim.com/use-jquery-to-achieve-the-picture-was-hidden-effects.html
matrix
本文章由 matrix 于2011年08月05日发布在Wordpress, 兼容并蓄分类下,目前没有通告,你可以至底部留下评论。
转载请注明:利用jquery实现图片显隐特效-HHTjim'S 部落格
关键字:

有2 条评论 »

  1. hhtjim hhtjim Moderator 2013-1-29 22:03:17 +0800#2

    加在主题footer.php下也无压力~ 🙄

  2. windows 7 key windows 7 key 2011-9-21 6:05:16 +0800#1

    I like the valuable information you provide in your articles. I’ll bookmark your weblog and check again here frequently. I am quite certain I will learn many new stuff right here! Best of luck for the next!

添加新评论 »

 🙈 😱 😂 😛 😭 😳 😀 😆 👿 😉 😯 😮 😕 😎 😐 😥 😡 😈 💡

插入图片

NOTICE: You should type some Chinese word (like “你好”) in your comment to pass the spam-check, thanks for your patience!