ticker tape

  • dreamer7
  • Student
  • Student
  • dreamer7
  • Posts: 95
  • Loc: UK

Post 3+ Months Ago

Ok i have this code for a ticker tape it works and everything but i would like it to stop on mouseover and also it resizes the width wen it scrolls across can anyone give me any help to get rid of that. Here is the code:
Code: [ Select ]
<SCRIPT>
var leftPos      = 187;
var topPos      = 162.5; 
var tickerWidth    = 200; 
var tickerSpeed    =  20; 
var tickerMoveBy   = -1.2;

var isIE = document.all ? true : false;
var tickerEntireWidth = 0;
var first = true;
var tickerWindowRightPos = leftPos + tickerWidth;
var tickerCurrentRightPos = tickerWindowRightPos - leftPos;
var tickerCurrentLeftPos = tickerWindowRightPos;
var tickerTimer;

function tickinit(_objId)
{
 if (isIE)
 {
  var tickerObj = document.all[_objId];
    var temp=tickerObj.style.width.toString();
    tickerEntireWidth=parseInt(temp.substr(0,temp.length-2));
  if (leftPos == 0 && topPos == 0)
    {
   leftPos = getLeft(tickerObj);
   topPos = getTop(tickerObj);
  }
  tickerObj.style.posTop = topPos;
 }
 tickerWindowRightPos = leftPos + tickerWidth;
 tickerCurrentRightPos = tickerWindowRightPos - leftPos;
 tickerCurrentLeftPos = tickerWindowRightPos;
 tickKill(_objId);
 tickerTimer=eval("setInterval('tick(\""+_objId+"\")', tickerSpeed);");
}

function tickKill(_objId)
{
 if(tickerTimer)
 {
  clearInterval(tickerTimer);
  tickerTimer=null;
 }
}

function getLeft(_obj)
{
 if (_obj.offsetParent)
  return (_obj.offsetLeft + getLeft(_obj.offsetParent));
 else
  return (_obj.offsetLeft);
}

function getTop(_obj)
{
 if (_obj.offsetParent)
  return (_obj.offsetTop + getTop(_obj.offsetParent));
 else
  return (_obj.offsetTop);
}

function tick(_objId)
{
 tickerCurrentLeftPos += tickerMoveBy;
 if (tickerCurrentLeftPos + tickerEntireWidth < tickerCurrentRightPos)
  tickerCurrentLeftPos = tickerWindowRightPos;
 cl = leftPos - tickerCurrentLeftPos;
 cr = tickerWindowRightPos - tickerCurrentLeftPos;
 if (isIE)
 {
  var _obj = document.all[_objId];
  _obj.style.posLeft = tickerCurrentLeftPos;
  _obj.style.posTop = topPos;
  _obj.style.clip = "rect(auto "+cr+"px auto "+cl+"px)";
  if (first)
     _obj.style.visibility = "visible";
 }
 first = false;
}

</SCRIPT>
  1. <SCRIPT>
  2. var leftPos      = 187;
  3. var topPos      = 162.5; 
  4. var tickerWidth    = 200; 
  5. var tickerSpeed    =  20; 
  6. var tickerMoveBy   = -1.2;
  7. var isIE = document.all ? true : false;
  8. var tickerEntireWidth = 0;
  9. var first = true;
  10. var tickerWindowRightPos = leftPos + tickerWidth;
  11. var tickerCurrentRightPos = tickerWindowRightPos - leftPos;
  12. var tickerCurrentLeftPos = tickerWindowRightPos;
  13. var tickerTimer;
  14. function tickinit(_objId)
  15. {
  16.  if (isIE)
  17.  {
  18.   var tickerObj = document.all[_objId];
  19.     var temp=tickerObj.style.width.toString();
  20.     tickerEntireWidth=parseInt(temp.substr(0,temp.length-2));
  21.   if (leftPos == 0 && topPos == 0)
  22.     {
  23.    leftPos = getLeft(tickerObj);
  24.    topPos = getTop(tickerObj);
  25.   }
  26.   tickerObj.style.posTop = topPos;
  27.  }
  28.  tickerWindowRightPos = leftPos + tickerWidth;
  29.  tickerCurrentRightPos = tickerWindowRightPos - leftPos;
  30.  tickerCurrentLeftPos = tickerWindowRightPos;
  31.  tickKill(_objId);
  32.  tickerTimer=eval("setInterval('tick(\""+_objId+"\")', tickerSpeed);");
  33. }
  34. function tickKill(_objId)
  35. {
  36.  if(tickerTimer)
  37.  {
  38.   clearInterval(tickerTimer);
  39.   tickerTimer=null;
  40.  }
  41. }
  42. function getLeft(_obj)
  43. {
  44.  if (_obj.offsetParent)
  45.   return (_obj.offsetLeft + getLeft(_obj.offsetParent));
  46.  else
  47.   return (_obj.offsetLeft);
  48. }
  49. function getTop(_obj)
  50. {
  51.  if (_obj.offsetParent)
  52.   return (_obj.offsetTop + getTop(_obj.offsetParent));
  53.  else
  54.   return (_obj.offsetTop);
  55. }
  56. function tick(_objId)
  57. {
  58.  tickerCurrentLeftPos += tickerMoveBy;
  59.  if (tickerCurrentLeftPos + tickerEntireWidth < tickerCurrentRightPos)
  60.   tickerCurrentLeftPos = tickerWindowRightPos;
  61.  cl = leftPos - tickerCurrentLeftPos;
  62.  cr = tickerWindowRightPos - tickerCurrentLeftPos;
  63.  if (isIE)
  64.  {
  65.   var _obj = document.all[_objId];
  66.   _obj.style.posLeft = tickerCurrentLeftPos;
  67.   _obj.style.posTop = topPos;
  68.   _obj.style.clip = "rect(auto "+cr+"px auto "+cl+"px)";
  69.   if (first)
  70.      _obj.style.visibility = "visible";
  71.  }
  72.  first = false;
  73. }
  74. </SCRIPT>
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ED
  • Student
  • Student
  • ED
  • Posts: 66
  • Loc: Halifax

Post 3+ Months Ago

pretty simple but show me it working.
  • dreamer7
  • Student
  • Student
  • dreamer7
  • Posts: 95
  • Loc: UK

Post 3+ Months Ago

its up on http://www.onspring.co.uk the thing u wont really b able to see is that it has a gap at the beginning that is almost the same colour as the background so it resizes after it gets half way thru its in the box next to bookmark me
d7
  • ED
  • Student
  • Student
  • ED
  • Posts: 66
  • Loc: Halifax

Post 3+ Months Ago

the page doesn't load for me.
  • dreamer7
  • Student
  • Student
  • dreamer7
  • Posts: 95
  • Loc: UK

Post 3+ Months Ago

how come doesnt ur broswer support frames or something??
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

That URL doesn't load for me either.
  • dreamer7
  • Student
  • Student
  • dreamer7
  • Posts: 95
  • Loc: UK

Post 3+ Months Ago

:shock: :?: :!: :?: that doesnt make sense it loads for me and i know it loads for someone else i know
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Are you sure you typed in the URL right? and try clearing you cache... I get a server not found page. Also its a UK page, try getting someone else outside of UK loading it. I am from WA state in the USA, and it does not load for me.
  • ED
  • Student
  • Student
  • ED
  • Posts: 66
  • Loc: Halifax

Post 3+ Months Ago

it doesn't load using babelfish as a proxy either.

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 70 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.