2

I'm trying to use the jQuery news ticker code from http://www.jquerynewsticker.com but seem to be unable to make it work.

I've reviewed the code on the code's home page, reviewed / compared my markup and code placement, tried to follow the code with Firebug and it still doesn't function. Perhaps I've made a mistake somewhere but I can't find it or perhaps there's some other thing I've missed.

I've put the code I'm using at:

http://www.homes-in-naperville.com/banana.html

I would welcome comments that would help me lead to a solution to get it working.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Sean
  • 21
  • 3
  • Please take another look at http://www.jquerynewsticker.com to see exactly how to implement the ticker in JavaScript. You're missing the basic code. – Blazemonger Nov 09 '11 at 15:19
  • Thanks for taking a look. In the source of my original link I have included the direct copies of the: – Sean Nov 10 '11 at 01:14
  • Oops. Thank you. In the source of my original link/page I have already included links to locally hosted copies of the: news ticker css - that gave me some generic formatting news ticker js file - the ticker code In addition I have injected inline my variables (newsheadline) and a link to my code that passes the id to the ticker() function and that is wrapped in a jQuery(document).ready(function($){ ... });. In that configuration the ticker code fires, runs, processes but does not generate any ticker-like output it just displays the first LI item statically. What basic code am I missing? – Sean Nov 10 '11 at 01:25

2 Answers2

1

In the javascript on your site you have put the javascript directly in the page without the DOM ready handler, and also the syntax is a little off.

Change it to the following and it should work:

<script type="text/javascript">
    $(function () {
        $('#ticker').ticker({
            speed: "0.10",
            pauseOnItems: "5000",
            fadeInSpeed: "600",
            fadeOutSpeed: "900"
        });
    });
</script>
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
  • Thanks As I said in the other comment in my original link I have my code wrapped in a jQuery(document).ready(function($){ ... }) block. I see the ticker() code being called when tracking it through Firebug I just can't work out where it 'breaks' and stops or which part of my code or markup is at fault. – Sean Nov 10 '11 at 01:30
0

attach this script to your site

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
Eslam Ahmad
  • 579
  • 7
  • 7