JS Auto Scroller - Not repeating and other problems !?!

This is a discussion on "JS Auto Scroller - Not repeating and other problems !?!" within the JavaScript Forum section. This forum, and the thread "JS Auto Scroller - Not repeating and other problems !?! are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old May 20th, 2008, 10:45
Junior Member
Join Date: Jan 2008
Location: UK
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
JS Auto Scroller - Not repeating and other problems !?!

Hi,

I have implemented an auto scrolling div (with RSS news feeds), the usual thing; you mouse over the text stops etc.. the problems arise with...

(a). the text will not repeat !
(b). if you mouse over the text quickly, the text begins to scroll at a crazy speed, you have to mouse back over it slowly to resume the normal speed ?!!?

here is the code in question ....

Code: Select all
 
<script type="text/javascript">var speed = 3; function init(){  var el = document.getElementById("trafficNews");  el.style.overflow = 'hidden';  scrollFromBottom();} var go = 0;function scrollFromBottom(){  var el = document.getElementById("trafficNews");  if(el.scrollTop >= el.scrollHeight-150){    el.scrollTop = 0;  };  el.scrollTop = el.scrollTop + speed;  if(go == 0){    setTimeout("scrollFromBottom()",50);  };} function stop(){  go = 1;} function startit(){  go = 0;  scrollFromBottom();}
window.onload = init;
</script>
<div id="trafficSignLarge">
<div id="trafficNews" onmouseout="startit();" onmouseover="stop();"><p class="spacer">
<?php require_once (ABSPATH . WPINC . '/rss-functions.php');
$url = 'http://www.highways.gov.uk/rssfeed/rss.xml';
$rss = fetch_rss( $url );
if ( $rss ) {
$i = 1;
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
$description = $item['description'];
echo "<p><h2><a href=$href>$title</a></h2>$description</p>";
if ($i == 10 ) break;
$i = $i + 1;
}
}
?>
<p class="spacer"></div><!--end of trafficNews div-->
</div><!--end of trafficSignLarge div-->
**This code is being implemented in Worpdress***

Last edited by slimboyfatz32; May 20th, 2008 at 10:50.
Reply With Quote

  #2 (permalink)  
Old May 21st, 2008, 13:00
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,229
Blog Entries: 9
Thanks: 2
Thanked 38 Times in 38 Posts
Re: JS Auto Scroller - Not repeating and other problems !?!

Java and javascript are entirely different languages. What you've got there is a mixture of javascript, HTML, and PHP.
__________________
CloudedVision, WebForumz Moderator
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Reply With Quote
  #3 (permalink)  
Old May 21st, 2008, 13:22
Ed Ed is offline
Highly Reputable Member
Join Date: Jul 2007
Location: Cork, Ireland
Posts: 699
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: JS Auto Scroller - Not repeating and other problems !?!

Moved.
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
Reply With Quote
  #4 (permalink)  
Old May 27th, 2008, 14:26
Junior Member
Join Date: Jan 2008
Location: UK
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Re: JS Auto Scroller - Not repeating and other problems !?!

Where has this been moved to ????
Reply With Quote
  #5 (permalink)  
Old May 27th, 2008, 22:50
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,229
Blog Entries: 9
Thanks: 2
Thanked 38 Times in 38 Posts
Re: JS Auto Scroller - Not repeating and other problems !?!

To the javascript forum
__________________
CloudedVision, WebForumz Moderator
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Reply With Quote
  #6 (permalink)  
Old May 28th, 2008, 07:51
Junior Member
Join Date: Jan 2008
Location: UK
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Re: JS Auto Scroller - Not repeating and other problems !?!

any advice ???
Reply With Quote
  #7 (permalink)  
Old May 28th, 2008, 22:41
CloudedVision's Avatar
Nerdy Moderator
Join Date: Feb 2008
Location: In My Own Little World
Age: 14
Posts: 1,229
Blog Entries: 9
Thanks: 2
Thanked 38 Times in 38 Posts
Re: JS Auto Scroller - Not repeating and other problems !?!

I think you'd be able to code it where it reaches the bottom and stops for a few seconds, then goes back to the top, but a continuous scrolling i don't think would be possible.
__________________
CloudedVision, WebForumz Moderator
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
RSS News Feed Auto Scroller ?? slimboyfatz32 JavaScript Forum 1 May 28th, 2008 22:57
HTML repeating problems?? tails007 Web Page Design 8 Jan 18th, 2008 13:12
scroller issue.. please help.. Perfection Studios Flash & Multimedia Forum 10 Oct 1st, 2006 04:18
News Scroller sobiaa JavaScript Forum 1 Dec 1st, 2005 11:59
DHTML news scroller Rob JavaScript Forum 7 Aug 21st, 2003 16:02


All times are GMT. The time now is 10:24.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43