为什么JQuery不工作在我的Tumblr? [英] Why is JQuery not working on my Tumblr?

查看:104
本文介绍了为什么JQuery不工作在我的Tumblr?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是CSS,HTML的新手,我真的不知道JQuery。我正在做一个Tumblr主题。我看到的是我发布小的JQuery的插件(我在这里使用正确的词?),他们添加一些小调整,例如使他们在用户滚动时淡出。如何和我可以在Tumblr中使用JQuery?

I'm kind of new to CSS, HTML and I really have no idea about JQuery. I'm making a Tumblr theme. What I see it is I post little JQuery 'plugins' (am I using the right word here?) and they add little tweaks to Div's for example making them fade when the user scrolls. How do I and can I use JQuery in Tumblr?

推荐答案

如果你想使用jQuery javascript库Tumblr主题,并且您不想在自己的服务器上托管jQuery库,那么您应该考虑Google AJAX库API。 AJAX库API是用于最流行的开源JavaScript库的内容分发网络和加载架构。

If you want to use the power of the jQuery javascript library in your Tumblr theme and you don’t want to host the jQuery library on your own server then you should consider the Google AJAX Libraries API. The AJAX Libraries API is a content distribution network and loading architecture for the most popular, open source JavaScript libraries.

将以下代码段(基于本文)放在头中标记,即可开始使用:

Put the following snippet (based on this article) in the head tag of your theme and you’re ready to go:

<script type="text/javascript" 
    src="http://www.google.com/jsapi"></script>

<script type="text/javascript">
  google.load("jquery", "1.3");
  google.setOnLoadCallback(function() {
    jQuery(function($) {
      // do some stuff here, eg load your tweets, ...
    });
  });
</script>

来源

这篇关于为什么JQuery不工作在我的Tumblr?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆