Quick Search for:  in language:    
PSC,article,shows,creating,IFRAME,scroller,si
   Code/Articles ╗ |  Newest/Best ╗ |  Community ╗ |  Jobs ╗ |  Other ╗ |  Goto ╗ | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Java/ Javascript Stats

 Code: 220,465. lines
 Jobs: 89. postings

 How to support the site

 
Sponsored by:

 
You are in:
 

Does your code think in ink?
Login





Latest Code Ticker for Java/ Javascript
Gobang
By Geniusbob Xu Qiang on 11/27


Click here to see a screenshot of this code!Salary
By Vikram Ivatury on 11/25

(Screen Shot)

Click here to see a screenshot of this code!A (part10) Powerful Swing Code to Maintain CD Database
By James Smith K on 11/25

(Screen Shot)

String Calculator
By MadokaCoder on 11/24


Chobi Dekha
By ShuvoRim on 11/23


Click here to see a screenshot of this code!A basic Client Server application II
By Ronald Holland on 11/23

(Screen Shot)

Bookmark image
By darren kurn on 11/22


myFT
By Owolabi Oyapero on 11/22


Click here to see a screenshot of this code!Simple Socket example
By Steven McElrea on 11/20

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites



 
 
   

Creating an iframe scroller (similar to the one used by PSC).

Print
Email
 

Submitted on: 4/1/2002 6:34:50 AM
By: Mike Thompson 
Level: Beginner
User Rating: By 8 Users
Compatibility:JavaScript

Users have accessed this article 10309 times.
 
 
     This article shows creating a IFRAME scroller similar to the one used by PSC on the left side of page.

This article has accompanying files
 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.

Creating an iframe scroller (similar to the one used by PSC).

Ok, so this is based mainly on a script by Dynamic Drive, but I think many people would be interested in it, since it creates a scroller very similar to the one you see on the left side of Planet-Source-Code. It's an iframe scroller where the contents is contained inside a external document.

The script comes in two parts:

Index.htm:

<!--This script by Dynamic Drive (http://www.dynamicdrive.com)-->
<!--Modified by Mike Thompson-->
<iframe id="datamain" src="external.htm" width=150 height=150 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>

External.htm

<html>
<body>

<div id="datacontainer" style="position:absolute;left:0;top:10;width:100%" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache">

<!-- ADD YOUR SCROLLER COMMENT INSIDE HERE--------------------->

YOUR CONTENT HERE

<!-- END SCROLLER CONTENT---------------------------------------->

<div>

<script language="JavaScript1.2">

//<iframe> script by Dynamicdrive.com //

//Specify speed of scroll. Larger=faster // (ie: 5)
var scrollspeed=cache=2

function initialize(){
marqueeheight=document.all? parent.document.all.datamain.height : parent.document.getElementById("datamain").getAttribute("height")
dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
dataobj.style.top=5
thelength=dataobj.offsetHeight
setTimeout("scrolltest()",200)
}


function scrolltest(){
dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed
if (parseInt(dataobj.style.top)<thelength*(-1))
dataobj.style.top=5
setTimeout("scrolltest()",50)
}


window.onload=initialize

</script>

</body>
</html>

The entire script is also attached as a zip file, so you can begin using it right away on your site.

winzip iconDownload article

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.


Other 6 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
4/5/2002 8:09:02 AM:Tycoon [ Oli ]
I haven't tried your code, but from a quick glance at it, i noticed a mistake. Just before the start of the javascript code, it should be </DIV> , and not
:)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/12/2002 5:27:34 AM:Tailgunner
good work.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/26/2003 3:51:19 AM:
wow.. it works.... u will look better with more customization...
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/12/2003 6:02:38 PM:
This code works just great, but a suggestion for the users that want to use this. It skips. So you need to put several
before the info.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/12/2003 6:04:36 PM:
An addendum to the previous comment, you need to put BREAKS in before the info. It didn't put the tag in. :(
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Java/ Javascript Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyrightę 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.