tags:

views:

42

answers:

4

Hello,

Check the following link in Chrome: http://www.bavarianblue.com/parts-list/?tags=struts

The site is totally jacked in IE - need to fix a bunch of CSS.

I use the follow Javascript to perform the animation (uses jquery.scrollTo-1.4.2-min.js);

jQuery(document).ready(function($) { //required for $ to work in Wordpress
    var moo = $(".tags").attr("rel");
    if (moo == ""){
        return;
    }else {
        var scrolling = $("."+moo).offset().top-100;
        $.scrollTo(scrolling, 800, {easing:'swing'} );
        $('.'+moo).animate({backgroundColor : "#4c4c4c", color : "white"}, function() {
            $(this).animate({backgroundColor : "#dcdcdc"}, function() {
                $(this).animate({backgroundColor : "#4c4c4c"}); //animation wasn't completing chain, thus all the nested functions.                                                        });
        $('.'+moo+' a').animate({color : "#ed9925"});
        }); 
    }
});

Any clue why it doesn't work? Not getting any errors in FF...

EDIT

As @Chouchenos pointed out, a script type wasn't declared, and I didn't close the tag. However, now FF doesn't generate an error, but the animation (changing the BG and the scroll) doesn't work.

A: 

It seems that the animate and setting the backgroundcolor doesn't work either. Have you tried debugging using Firebug? I suspect that the line if (moo == "") might be returning something unexpected in FF.

I suppose that the problem is that you have display:none on the div with the class="tags". FF possibly won't allow you to scroll to an element that is not displayed on the page while Chrome does.

You can test this by temporarily removing the display:none style from the div and seeing whether it works in FF

Daniel Dyson
FF says $.scrollTo is not a function .... not sure how to fix that.
Jared
Well... now FF gets `rel` info, but still doesn't animate. Still hunting it down....
Jared
A: 

moo =='' : return; and its returning, am I missing something ? Can you give steps to reproduce as what is NOT working ? There is no .tags anywhere .. the tags div contain js

Stewie
.tags is there.... in the link I provided, see `<DIV class="tags" rel="struts" style="display:none;"></DIV>` It's supposed to animate in FF and it's not, only in chrome.
Jared
A: 

ScrollTo isn't a native jQuery method; you need Flesler's ScrollTo plug-in.

Elf Sternberg
as mentioned in the OP, I am using jquery.scrollTo-1.4.2-min.js
Jared
You're right, my apologies. However, loading your page in FireFox and looking at the network traffic, it's never loading jquery.scrollTo-1.4.2-min.js. Even more odd, when I pull it up in Firefox, it says that the src attribute isn't a link. I suspect that something is odd about that script tag, something Chrome's parser tolerates, but Firefox's does not.
Elf Sternberg
+1  A: 

Both FF and IE tell me that

$.scrollTo is not a function

But surprisingly, it works on chrome.

EDIT : Firefox makes an error here I think :

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js"/&gt;
<script src="http://www.bavarianblue.com/wp-content/themes/Polished/js/jquery.scrollTo-1.4.2-min.js"&gt;&lt;/script&gt;

It may be like this :

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js"&gt;&lt;/script&gt;
<script src="http://www.bavarianblue.com/wp-content/themes/Polished/js/jquery.scrollTo-1.4.2-min.js"&gt;&lt;/script&gt;

That's why scrollTO doesn't load I think

Chouchenos
Plus, with web developper tool bar, it tells me jquery UI is load like this : <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js"> The <script> doesn't close... error, js not load, bam!And apparently, it doesn't bother Chrome...
Chouchenos
I was just figuring that out, didn't see the closing tag problem though! Thanks for pointing that out... however still a problem, see edit
Jared
It's still the same problem, you should put <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js"></script> instead of <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.js"/> ... firebug still says scrollTo is not a function, it means the js isn't loaded or that you spelled scrollTo wrongly.
Chouchenos
got it, that was the problem!!!
Jared