PDA

View Full Version : How to move the records towards up in asp page in a frame !



itchock
08-03-2006, 10:52 AM
Hi,

I created a asp page thorugh Front Pgae & added a frame in the right side of my page. I Populated the data from my Northwind(Ms Sql 7) database in a table inside the Frame. It works fine.

I need to move the table towards up.
For Example if i have 15 records in the table. Then i need to move the table slowly towards up, so the first record will go up and dissappear and then second, similarly upto 15th record. After that from the bottom of the Frame the firrst records should appear and go on.

How to do this task, i don't know exactly this belongs to html side or asp side.

Can any 1 give me guidence abou this.

Thankyou,
Chock.

Manny
08-29-2006, 12:09 PM
Create the following .asp page (replacing the part between the comments with your results from you database:

<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--------------------->

PUT THE RESULTS OF YOUR SQL HERE

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


<script language="JavaScript1.2">
//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=50
thelength=dataobj.offsetHeight
scrolltest()
}

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

window.onload=initialize

</script>
</body>
</html>




Now. put this code on the page where you want to show your results moving up:

<iframe id=datamain src="thenameofthepageabove.asp" width="300" height="300" marginwidth=0 marginheight=0 hspace="0" vspace="0" frameborder=1 scrolling=no>
</iframe>