Old 13-10-2005, 22:28   #1 (permalink)
osiris
Os|ris
 
Join Date: Mar 2005
Posts: 28
Send a message via AIM to osiris
Design Question

Ok, I am working on a site...and the home page has a little box on it that is supposed to be for news, and I was wondering if there was anyway to maybe put a scrolling marquee in there, but have it pull the information out of a separate text file or something, for easy updating? is there such a thing where you can just tell it to include a text file or something so that I do not have to mess with the HTML design any just to update the news? Any help would be greatly appreciated!!

Sincerely, Osiris
  Reply With Quote
Old 13-10-2005, 23:35   #2 (permalink)
Rakan
Senior Member
 
Join Date: Mar 2005
Posts: 567
You can have an iFrame with some JavaScript to get it scrolling, then simply have the source for the iFrame a txt file...

Click on the examples to see what I mean...
http://www.samisite.com/test-csb2nf/id43.htm

Hope this helps!
  Reply With Quote
Old 14-10-2005, 00:15   #3 (permalink)
osiris
Os|ris
 
Join Date: Mar 2005
Posts: 28
Send a message via AIM to osiris
It seemed logical and just what I was looking for, unfortunately I haven't been able to figure it out yet. I'll keep trying, but maybe someone who has a better understanding of iFrames could get me going in the right direction? Thanks for your replies guys.
  Reply With Quote
Old 14-10-2005, 01:15   #4 (permalink)
Rakan
Senior Member
 
Join Date: Mar 2005
Posts: 567
Hope this helps... give it a shot...

Quote:
iFrame code for CSB - scrolling iFrame

Each SCROLLING IFRAME requires two pages.
Build each page, place the codes, then modify as necessary for your site.


Create the iFrame Page
Create a page within which the iframe will appear. We'll call that the iFrame Page.

Using Insert > HTML Code (or webgem in Trellix) add the following code:

<!--BEGIN code for iFrame Page>
<!--<IFRAME> scroller- By Dynamic Drive-->
<!--For full source code and more DHTML scripts, visit http://www.dynamicdrive.com-->
<!--This credit MUST stay intact for use-->
<iframe id="datamain" src="mycontentspage.htm" width=400 height=250 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=1 scrolling=no></iframe>
<!--END of code for iFrame Page>


Create the Contents Page
FORMAT: You may want to create a new page layout for iFrame content pages that has no static text, borders, etc. All of the page will attempt to load into the iframe. If you have a border it will take up extra room you may not like. If you want a long pause between the reload of the content, add extra spaces (blank lines) below the text. (See example 3)
PLACEMENT: You will not want the Content Page on a main sequence line because you want access to that page only through the iFrame window. This page can be made in the same site file as the iFrame page, or in a different directory, or a different site that you build! You must be able to place codes into the Contents page! For this example, all pages are in the same tlx file.

At the very top of the Contents Page, use Insert > HTML Code to insert the following:

<!--BEGIN code for Contents Page TOP>
<div id="datacontainer" style="position:absolute;left:0;top:10;width:100%" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache">
<div>
<!--END code for Contents Page TOP>

At the very bottom of the Contents Page, use Insert > HTML Code to insert the following:

<!--BEGIN code for Contents Page BOTTOM>
</div>
<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").getAttr ibute("height")
dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
dataobj.style.top=5
thelength=dataobj.offsetHeight
scrolltest()
}
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>
<!--END code for Contents Page BOTTOM>

Now, go back and modify the codes as necessary for your site!
  Reply With Quote
Old 14-10-2005, 05:17   #5 (permalink)
datahound
Spare Parts
 
datahound's Avatar
 
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 5,118
Great link Rakan.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8