首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >TypeError:$(“.幻灯片-out-div”).tabSlideOut不是函数

TypeError:$(“.幻灯片-out-div”).tabSlideOut不是函数
EN

Stack Overflow用户
提问于 2012-09-13 11:03:55
回答 2查看 2.2K关注 0票数 1

我基本上是试图遵循http://www.building58.com/examples/tabSlideOut.html教程,我有这个错误,有什么问题吗?

代码语言:javascript
复制
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>

<script src="http://tab-slide-out.googlecode.com/files/jquery.tabSlideOut.v1.3.js"></script>

代码语言:javascript
复制
            <script>
         $(function(){
             $('.slide-out-div').tabSlideOut({
                 tabHandle: '.handle',                              //class of the element that will be your tab
                 pathToTabImage: 'images/contact_tab.gif',          //path to the image for the tab (optionaly can be set using css)
                 imageHeight: '122px',                               //height of tab image
                 imageWidth: '40px',                               //width of tab image    
                 tabLocation: 'left',                               //side of screen where tab lives, top, right, bottom, or left
                 speed: 300,                                        //speed of animation
                 action: 'click',                                   //options: 'click' or 'hover', action to trigger animation
                 topPos: '200px',                                   //position from the top
                 fixedPosition: false                               //options: true makes it stick(fixed position) on scroll
             });
         });



         </script>
        <div class="slide-out-div">
        <a class="handle" href="http://link-for-non-js-users.html">Content</a>
        <h3>Contact me</h3>
        <p>Thanks for checking out my jQuery plugin, I hope you find this useful.
        </p>
        <p>This can be a form to submit feedback, or contact info</p>
    </div>

04:54:57.945 TypeError:$(“.幻灯片-out-div”).tabSlideOut不是一个函数@

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-09-13 11:14:25

如果浏览器中有调试器,大多数现代的调试器都会按F12来检查它,然后可以查看是否正确加载了所有脚本,使用typeof函数可以检查tabSlideOut是什么(未定义的或函数)。

我想你是从这里复制过来的:http://www.building58.com/examples/tabSlideOut.html。你能再检查一下,如果你复制了一切,包括css,正确吗?

票数 3
EN

Stack Overflow用户

发布于 2012-09-13 11:07:04

试着使用

代码语言:javascript
复制
jQuery(function() {

});

而不是$

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12404821

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档