djl wrote:
I'm a bit lost with your suggestion here?
Are you saying I should add the lines:
self.items = jQuery("li", self);
self.items.not(":eq(0)").hide().end();
self.currentitem = 0;
into the replacecontents function?
Please advise.
Thanks.
That is what I meant, yes - at the end of that function.
You'll note that you got a reply from Sam Collett as well. Since I
believe he wrote the plugin you're using you should probably use his
suggestion rather than mine:
http://groups.google.com/group/jquery-en/browse_frm/thread/d9f5772e2bced5df
If you're still experiencing problems, your best best is to post a link
to a live page so people can see what is going on.
--
Best wishes,
Dave Cardwell.
http://davecardwell.co.uk/javascript/jquery/
On 27 Apr 2007, at 15:28, Dave Cardwell wrote:
djl wrote:
Hi there,
I've got a simple page that uses the newsticker plug-in
(http://www.texotela.co.uk/code/jquery/newsticker/), as follows:-
<snip>
The problem is clicking the 'Replace' button runs the
*replacecontents* function which updates the div contents with a
list, thus breaking the ticker effect as below:-
<snip>
If you look at the source of that plugin, it does some initialisation
when you call .newsTicker(). You should be able to extrapolate from
this what you need to do when you change the content.
Specifically the lines:
self.items = jQuery("li", self);
self.items.not(":eq(0)").hide().end();
self.currentitem = 0;
...where "self" is the news ticker <ul>. I believe (i.e. not tested)
that if you performed those three lines after the replacement the
ticker should continue to function.
Let us know how you get on.
--
Best wishes,
Dave Cardwell.
http://davecardwell.co.uk/javascript/jquery/