首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >对象不支持属性或方法“”<tabSlideOut>“”错误

对象不支持属性或方法“”<tabSlideOut>“”错误
EN

Stack Overflow用户
提问于 2014-07-08 19:48:58
回答 3查看 788关注 0票数 0

为了做到这一点,我关注了this链接。

我的代码是:

代码语言:javascript
复制
<script src='jquery-1.10.1.min.js'></script> // this file is in the same folder.
<script src="http://tab-slide-out.googlecode.com/files/jquery.tabSlideOut.v1.3.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
    $('.slide-out-div').tabSlideOut({
    tabHandle: '.handle',                              //class of the element that will be your tab
    pathToTabImage: 'contact_tab.gif',                  //path to the image for the tab *required*
    imageHeight: '122px',                               //height of tab image *required*
    imageWidth: '40px',                               //width of tab image *required*    
    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>
<style>
    .slide-out-div {
    padding: 20px;
    width: 250px;
    background: #ccc;
    border: 1px solid #29216d;
}
</style>
<html>
    <head>
    </head>
    <body>
        <div class="slide-out-div">
            <a class="handle" href="http://link-for-non-js-users">Content</a>
            <h3>This is extra content</h3>
            <p>Something that wasn't important enough to be in your main body, 
           but that you wanted to hide off the side of your screen for some reason.
            </p>
            <p>Could be a form to submit feedback, or contact info</p>
        </div>
    </body> 
</html>  

但是当我在浏览器中运行这个文件时,我得到了输出:

我应该怎么做才能让标签完全打开以显示表单?

EN

回答 3

Stack Overflow用户

发布于 2014-07-08 19:52:08

看起来您尚未在您的html页面中链接该插件。确保已将其添加到query之后

代码语言:javascript
复制
<script src="http://tab-slide-out.googlecode.com/files/jquery.tabSlideOut.v1.3.js"></script>
//you're missing this.
票数 1
EN

Stack Overflow用户

发布于 2014-07-08 19:54:11

我想你忘了加jquery.tabSlideOut.js了。请看演示here的示例代码和下面的代码行:

代码语言:javascript
复制
<script src="http://tab-slide-out.googlecode.com/files/jquery.tabSlideOut.v1.3.js"></script>
票数 0
EN

Stack Overflow用户

发布于 2014-07-08 19:55:43

你所有的scrpt和style都应该放在html的头部分。请安排一下

代码语言:javascript
复制
<html>
    <head>
<script src='jquery-1.10.1.min.js'></script> // this file is in the same folder.
<script src="http://tab-slide-out.googlecode.com/files/jquery.tabSlideOut.v1.3.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
    $('.slide-out-div').tabSlideOut({
    tabHandle: '.handle',                              //class of the element that will be your tab
    pathToTabImage: 'contact_tab.gif',                  //path to the image for the tab *required*
    imageHeight: '122px',                               //height of tab image *required*
    imageWidth: '40px',                               //width of tab image *required*    
    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>
<style>
    .slide-out-div {
    padding: 20px;
    width: 250px;
    background: #ccc;
    border: 1px solid #29216d;
}
</style>
    </head>
    <body>
        <div class="slide-out-div">
            <a class="handle" href="http://link-for-non-js-users">Content</a>
            <h3>This is extra content</h3>
            <p>Something that wasn't important enough to be in your main body, 
           but that you wanted to hide off the side of your screen for some reason.
            </p>
            <p>Could be a form to submit feedback, or contact info</p>
        </div>
    </body> 
</html> 
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24631073

复制
相关文章

相似问题

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