English 中文(简体)
JQuery 成文,在IE.,而不是在IE.,
原标题:JQuery Script, Works in Firefox, not in IE, Chrome

我有以下文字,根据封闭/可变变量的状况,推倒了集装箱倒塌和另一 up,反之亦然。

文字在火ox中操作,然而,在IE和Mook,它只是表面上的工作:

谁能建议?

许多人感谢! 页: 1

(The OCH var takes the height of a continer which elements are loaded into via ajax, so it then knows when to open it again how many px to open to - is this the best way?)

            $(document).ready(function()
            {
                //Grab the height of the container after its loaded with all the calls in...
                var och = $( #calls ).height();
                //Are we allowed to close this panel yet?
                var enabled = false;
                //is the panel closed or not?
                var closed = false;
                $(".survey-description").click(function () {
                    if (enabled == true) {
                        if (closed == false) {
                            $(this).closest("#calls").stop().animate({"height": "44px"}, "fast");
                            closed = true;
                        }
                        else {
                            $(this).closest("#calls").stop().animate({"height": och}, "medium");
                            closed = false;
                        }
                    }
                });

                $(".linktoCall").click(function () {
                    if (closed == false) {
                        //Now we can toggle the top panel...
                        enabled = true;
                        $(this).closest("#calls").stop().animate({"height": "44px"}, "fast");
                        closed = true;
                    }
                });

            });

这里的EDIT是所提供内容的约html。

<div id="survey-description"></div>
<div id="calls">
    <div>
        <p onclick="showCall( tgkn5xabgnivkaf );" id="notstarted" class="linktoCall">59677 tgkn5xabgnivkaf<br>NOT STARTED - SAVED</p>
    </div>
</div>

<div id="aCall">
</div>
最佳回答

Looking at the HTML snippet I guess it should be

<div class="survey-description"></div>

because the selector $( .survey-description ) refers to a class, not an id.

问题回答

This is mostly a quick guess as I don t know the html structure in question and don t have time to check the rest, but if there are conflicting element ids (such as two elements with the id "calls") different browsers will behave differently. So check do a check for this to make sure that is not the problem.

(Also, use ==比较,而不是=)

it might not work if your html code is not valid... and I bet you didn t close a div or something...

页: 1

Please also remove just for test the "px" value from

animate({"height": "xxpx"} ...

并且

animate({"height": 25}...




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签