MakeMineATriple

New features added to news ticker plugin

Posted on 2 October 2010 by bryan

Filed under

I’ve just released a new (beta) version of my news ticker plugin. It adds two commonly-requested features:

  1. An option to resume the animation on mouseOut (“resumeOffHover” setting)
  2. Support for attributes on links within the news item list - any attributes added to an anchor will be carried through.

Version 2.3.1-beta can be downloaded from the jQuery plugin page. The documentation contains notes on the functionality.

Comments (11 so far)

If you add the following to line 239 it will allow you to set an additional “resume delay” after the resumeOffhover function.

Change:

            if (settings.resumeOffHover) { // only allowed if stopOnHover enabled

                tickerElement.bind({

                    mouseout: function(event) {

                        tickerData = tickerElement.data(name);

                        if (!tickerData.animating) { // if already animating, don’t start animating again

                            $(tickerData.newsList).trigger(“resume”);

                            if (debugMode) {

                                console.log(‘resumeoffhover’ + tickerData.currentItem + ’ ’ + tickerData.animating);

                            }

                        }

                    }

                });

            }

        }

 

To:

            if (settings.resumeOffHover) { // only allowed if stopOnHover enabled

                tickerElement.bind({

                    mouseout: function(event) {

                        tickerData = tickerElement.data(name);

                        if (!tickerData.animating) { // if already animating, don’t start animating again

 

                            setTimeout(function() {

                                $(tickerData.newsList).trigger(“resume”);

                            }, 700);

 

                            //$(tickerData.newsList).trigger(“resume”);

                            if (debugMode) {

                                console.log(‘resumeoffhover’ + tickerData.currentItem + ’ ’ + tickerData.animating);

                            }

                        }

                    }

                });

            }

        }

you could further develop this to be an additional variable in the global settings.

 

Andrew 19 Nov 2010 - 10:57

Hello Bryan,

I’m trying to add your BBC-style scroller to our institutional homepage. I followed your instructions and used your code to parse and display entries from our rss feed (http://www.norwich.edu/news.xml).

It’s working well in Firefox, but not in IE7. Is there additional code required for IE…something to do with ActiveX?

Any help would be greatly appreciated. I love the way your ticker displays, and beings able to use our rss feed to populate the ticker would save our web editor an extra step.

best,

Eric

Eric 08 Jan 2011 - 18:48

Hello again Bryan,

The working example is located here:

http://www.norwich.edu/indexVIDEO.html

Thanks again,

Eric

Eric 08 Jan 2011 - 18:49

Hi Eric,

There seems to have been a bug relating to IE 6/7. Another user reported is and supplied a fix, which is now implemented in version 2.3.3.

I don’t have ready access to IE just now but if you’d like to download that new version from http://plugins.jquery.com/project/BBCnewsTicker and give that a go, hopefully it’ll solve your problem. Do let me know how you get on - and if there’s still an issue I’ll be happy to take a look.

Best wishes,

Bryan

bryan 11 Jan 2011 - 23:51

Hi,

I’ve found that version 2.3.4 doesn’t seem to include the URLs properly - instead of linking to the news item the <a> tag looks something like: <a href=”[object Object]”>

I’ve tried with various versions of jQuery, same problem with each. I’ve reverted back to v2.2 of your script.

Great work by the way, just what I was looking for!

Anonymous 09 Mar 2011 - 16:33

 

I have configured version  2.3.4 and set stopOnHover: true. Mouseover and Out  function are triggering over the whole container. whereas it should be triggered only when we move mouse over the scrolling text. Need your help to sort it out.

Thanks,

Malik 15 Mar 2011 - 10:32

Hi there,

You’ll want the latest release 2.3.6 - it should sort that bug out, sorry about that. http://plugins.jquery.com/project/BBCnewsTicker

Bryan

bryan 16 Mar 2011 - 01:25

Hi Malik,

That’s actually intended functionality, because when using the hover to stop/resume, you’d tend to get jittery behaviour if the trigger isn’t triggered by hover over/out of the ticker container rather than on links with display:inline;

You’d need to adjust the tickerElement.bind() lines to change this to bind to the links themselves, but because I’ve not found that to work reliably cross-browser, it’s not functionality I’d want to build into the ticker.

I would recommend that you size the ul and style it to make the space it takes up clearly part of the ticker to help give users the right expectations.

Sorry if that’s not quite the answer you were looking for, but I hope you see the reasoning behind it.

Incidentally, there’s a release 2.3.6 (just released) which fixes an unrelated bug in 2.3.4 - you’ll need to update as 2.3.4 won’t work properly.

Best,

Bryan

bryan 16 Mar 2011 - 01:39

Hi Bryan,

With version 2.3.6, The ticker is not properly functioning with Mozilla FireFox. It cannot control the tickerRate when the  Mouse Out event triggers. I have set the tickerRate to 50.  so i have  to revert back to version 2.3.4.

Thanks for your prompt reply. 

Malik

Malik 16 Mar 2011 - 07:23

Hi Malik,I’ve taken a *really* quick peek (off to work in a sec!) since I’ve not seen issues with that. Seemed ok for me. Try it at e.g. 80 and compare with 200… Maybe there is some side effect with fast rates, though a quick test at 20 seemed ok.Will look properly later, but definitely don’t use 2.3.4 as the links won’t work (oops!) Can you clarify the detail of the problem you were seeing to help me investigate?BestBryan

bryan 16 Mar 2011 - 07:58

I need right to left news ticker(BBC news ticker if it exists). who can help me?

Anonymous 11 Apr 2011 - 07:26

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <strong> <cite> <code> <ul> <ol> <li> <p>
  • Lines and paragraphs break automatically.
  • Adds typographic refinements.