SunQuest
 
           Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old February 6th, 2004, 12:38 PM
Rich's Avatar
Rich Rich is offline
Administrator
Developer Shed Admin.
 
Join Date: Sep 2003
Location: Fort Lauderdale, FL
Posts: 151 Rich User rank is Sergeant (500 - 2000 Reputation Level)Rich User rank is Sergeant (500 - 2000 Reputation Level)Rich User rank is Sergeant (500 - 2000 Reputation Level)Rich User rank is Sergeant (500 - 2000 Reputation Level)Rich User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 11 h 37 sec
Reputation Power: 10
Scrolling Button

<!--
this code was written by Mickel
Version 1.0 -- 21 August 2001
-->
<HTML>
<HEAD>
<TITLE>Scrolling Button Test</TITLE>
<SCRIPT>
// Setting some global variables here
var ScrollPos = 0; // Initial Index of position in MyScrollText
var NormalText; // Text of the button before mouseover
var MyObject;// Object to be manipulated
var MyScrollText; // Text to be scrolled on object
var MyInterval; // ID for Interval
var Spaces = ""; // Spaces for padding
// Usage SetScroll(true|false,this,[Text
// to be Scrolled])
function SetScroll(Activate,Object,ScrollText)


{
if (Activate == true) // Check to see if scroll needs to be started when mouse is over object


{
NormalText = Object.value; // NormalText is actual Object
var Spaces = "";
for (i=0;i < NormalText.length; i++)
Spaces += " "; // Padding for scroll text is a Space
MyObject = Object; // MyObject is this object
MyScrollText = Spaces + ScrollText + Spaces; // Adding spaces on each side for scrolling effect
MyInterval = window.setInterval("ScrollText();", 100); // Set interval for 100 mseconds (Change this number for fast or slower scrolls)
}
else


{
window.clearInterval(MyInterval); // Mouse has left the object, interval in cleared (cancelled)
ScrollPos = 0; // Index for position in MyScrollText has been set back to initial value
if (NormalText != null) // If the NormalText has a value
Object.value = NormalText; // Set the button back to its original value
}
}
function ScrollText()


{
MyObject.value = MyScrollText.substr(ScrollPos,NormalText.length) // Object text becomes substring of MyScrollText
ScrollPos ++; // ScrollPos is increased by 1
if (ScrollPos > MyScrollText.length) // If the ScrollPos if more than the length of MyScrollText
ScrollPos = 0; // then the Index position will be set back to 0 (beginning)
}
</SCRIPT>
</HEAD>
<BODY>
<! You can use any button with any name>
<! Change to width of the button for accomodate your text>
<INPUT type="button" style="width:100" value="Test Button"
onmouseover="SetScroll(true,this,'Click here to do Something!');" onmouseout="SetScroll(false,this)">
<!Also works with an Input Box or similar objects that use the value method>
</BODY>
</HTML>

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Scrolling Button


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway