C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Advanced JavaScript - Status bar effects Part 3


Posted Date: 28 Apr 2006    Resource Type: Articles    Category: General
Author: Chetankumar Digambarrao AkarteMember Level: Gold    
Rating: Points: 10



Introduction



With the help of JavaScript we can add our favorite message with marquee effect. For that we create an object with a constructor, a special type of function that prepares a new object for use by initializing the memory it takes up. Objects are created by applying the new operator to their constructors. This operator causes the constructor to which it is applied to create a brand-new object, and the nature of the object that is created is determined by the particular constructor that is invoked. Here we creates a new setStatusmessage() object and places a reference to it in the variable scroll. Here we define function function scroller() which scroll our message. Here first we add blank spaces before message and reduce one space per loop. And refresh status message by setTimeout ('scroller()',scroll.delay). After shift all message by scroll.out = scroll.msg.substring(-scroll.pos,scroll.msg.length). Then we make message again ready to scroll.




Source Code



 
< SCRIPT language=JavaScript>

var scroll = new setStatusmessage()

function setStatusmessage() {
this.msg = "This is Scrolling Message...!!!"
this.out = " "
this.pos = 100 // how wide is the scroller?
this.delay = 50 // milliseconds between shifts
this.i = 0
}

function scroller() {
for (scroll.i = 0; scroll.i < scroll.pos; scroll.i++) {
scroll.out += " "
}

if (scroll.pos >= 0)
scroll.out += scroll.msg
else scroll.out = scroll.msg.substring(-scroll.pos,scroll.msg.length)
window.status = scroll.out
scroll.out = " "
scroll.pos--
if (scroll.pos < -(scroll.msg.length)) {
scroll.pos = 100
}
setTimeout ('scroller()',scroll.delay)
}
scroller()

< /SCRIPT>








Summary



This artical gives an idea to add Message Marquee at Status Bar of Web Browser




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Status Bar effects with Javascript  .  Status Bar effects using Javascript  .  Status Bar effects  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Advanced JavaScript - Status bar effects Part 2
Previous Resource: Advanced JavaScript - Status bar effects Part 4
Return to Discussion Resource Index
Post New Resource
Category: General


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use