我的滑出标签只有一半的时间,为什么?

时间:2013-05-06 13:05:32

标签: jquery html css

(UPDATE。 我的解决方案:如果我不使用外部CSS,只是HTML文档中的样式,一切似乎都有效。真的很奇怪,但现在确实有效,以前从未遇到类似这样的事情,如果有人能解释为什么会发生这种情况会很棒 )

我在这里疯了,这个滑出式标签我正在按预期工作。然后我重新加载页面,它从侧面跳出一点,露出标签内的内容。然后我重新加载,但事实并非如此。重新加载,问题又回来了......

这是我的代码:

CSS:

.slide-out-div {
    padding: 1px;
    width: 243px;
    height: 210px;
    background: white;
    border: 1px solid #29216d;
}
.handle {
    background: url(bilder/contact_tab.gif);
    height:174px;
    width:30px;
}

和Jquery:

$(function () {
    $('.slide-out-div').tabSlideOut({
        tabHandle: '.handle', //class of the element that will become your tab
        pathToTabImage: 'null', //path to the image for the tab //Optionally can be set using css
        imageHeight: 'null', //height of tab image //Optionally can be set using css
        imageWidth: 'null', //width of tab image //Optionally can be set using css
        tabLocation: 'left', //side of screen where tab lives, top, right, bottom, or left
        speed: 200, //speed of animation
        action: 'click', //options: 'click' or 'hover', action to trigger animation
        topPos: '90px', //position from the top/ use if tabLocation is left or right
        leftPos: '20px', //position from left/ use if tabLocation is bottom or top
        fixedPosition: false //options: true makes it stick(fixed position) on scroll
    });
});

和HTML:

<div class="slide-out-div">
    <a class="handle1" href="http://link-for-non-js-users.html">Contact/Booking</a>

    <img src="bilder/contact_tab.gif" class="handle" />
    <div id="contact-area">
        <form action="mail.php" method="POST">
            <p>Name</p>
            <input type="text" name="name" id="name" />
            <p>Email</p>
            <input type="text" name="email" id="email" />
            <p>Message</p>
            <textarea name="message" rows="6" cols="25" id="message"></textarea>
            <br />
            <input type="submit" value="Send" class="submit-button" />
        </form>
    </div>
</div>

http://jsfiddle.net/isherwood/G9qkw/1

0 个答案:

没有答案