3

In my javascript I use the jquery animate() function to slide tweets automatically.

Code:

function movefeeds() { var element = jQuery("#Feeds"); var position = element.position(); if(position.left == 2000){ element.css("left", "500px"); } element.animate({ "left": "-=500px" }, "slow"); } 

In every browser to code does exactly what it must do: sliding. But in Chrome it is not sliding always, it is sliding half the time. And even if it slides, left gets really bad values (ie. 584.2132312 instead of 500, 1000 etc.)

Any suggestion would be appreciated :-)

EDIT: Looks like a css issue: chrome (from version 11) seems to have some trouble with overflow:hidden

EDIT 2: See this question

2
  • 1
    An alternate approach might be to use the hide & slide feature of jQuery UI. Commented Jun 21, 2011 at 12:50
  • 1
    Cant reproduce that in this fiddle Commented Jun 21, 2011 at 13:20

2 Answers 2

2

Could not find any solution for using overflow:hidden in chrome. So I removed the overflow from my css and put some div's with z-index over the tweets to hide them.

Found my solution in this: Question

Sign up to request clarification or add additional context in comments.

Comments

0

This may seem like an odd answer, but it's consistent with what I've seen happen in chrome before with animations:

Are you including your javascript after your CSS? Depending on how your page is set up, I've seen Chrome flake out as it's trying to run javascript before CSS styles are loaded, so your animation won't work because it doesn't have the element's position attribute loaded yet.

3 Comments

Javascript is included after all css includes. position gets a value when debugging
First of all check out the "position" value first by insert alert(position); before the IF statement...then you will know the true value of "position".
@BorisD position is exactly what is supposed to be. But the chrome browser doesn't show my tweet at that position

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.