4 Replies - 767 Views - Last Post: 01 July 2012 - 07:17 AM

#1 cookiemap  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 06-June 12

Trouble using this Javascript Stock Ticker

Posted 29 June 2012 - 07:17 AM

Hi DreamInCode, I've tried to implement this Javascript Stock Ticker found here: http://devedge-temp....1/stock-ticker/ with my wordpress website but I can't figure out how to insert this code into my site. I'm new to Javascript and figured I would just need to paste the code into the footer.php of my wordpress blog but apparently its not that simple :sweatdrop:

Theres a stock-ticker.js and stock-ticker.css file. I would be very thankful for some help on getting this to work. Thank you DIC :sorcerer:

Is This A Good Question/Topic? 0
  • +

Replies To: Trouble using this Javascript Stock Ticker

#2 ThrowsException  Icon User is offline

  • D.I.C Head

Reputation: 33
  • View blog
  • Posts: 83
  • Joined: 21-February 12

Re: Trouble using this Javascript Stock Ticker

Posted 29 June 2012 - 02:38 PM

your page would have to reference the javascript file and style. start the ticker in a script tag giving it the name of the ticker object and the div where it is going to be stored. The only thing with this is that his ticker isn't actually pulling data from anywhere it looks like he just hard coded a bunch of divs to scroll along. Neat tutorial for using the DOM though. and the reason the script to start the ticker is below the div tag is because if you try to start the ticker before the html loads it won't run. You can solve this with some JQuery document on ready.

<link href="ticker-style.css" rel="stylesheet" />
<link href="ticker-style.css" rel="stylesheet" />

<body>
<div id="tickerID" class="ticker">
</body>
<script>
     var ticker = new Ticker('ticker', 'tickerID', 1, 45);
     ticker.start();
</script>


Was This Post Helpful? 0
  • +
  • -

#3 ThrowsException  Icon User is offline

  • D.I.C Head

Reputation: 33
  • View blog
  • Posts: 83
  • Joined: 21-February 12

Re: Trouble using this Javascript Stock Ticker

Posted 29 June 2012 - 03:01 PM

View PostThrowsException, on 29 June 2012 - 04:38 PM, said:

<link href="ticker-style.css" rel="stylesheet" />
<link href="ticker-style.css" rel="stylesheet" />



Sorry that should look like
<script src="stock-ticker.js" ></script>
<link href="ticker-style.css" rel="stylesheet" /


Was This Post Helpful? 0
  • +
  • -

#4 cookiemap  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 06-June 12

Re: Trouble using this Javascript Stock Ticker

Posted 29 June 2012 - 04:52 PM

ok thanks 'ThrowsException' I'll try that :bigsmile:
Was This Post Helpful? 0
  • +
  • -

#5 ThrowsException  Icon User is offline

  • D.I.C Head

Reputation: 33
  • View blog
  • Posts: 83
  • Joined: 21-February 12

Re: Trouble using this Javascript Stock Ticker

Posted 01 July 2012 - 07:17 AM

Great. Let me know how it works out for you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1