help with html

Status
Not open for further replies.

nmunoz

New Member
Messages
5
Reaction score
0
Points
0
I want to put a scroll for some dynamic contet on my webpage, but I do not know how.
I tried putting it inside a textarea but that did not work. Is there any way I cuould put a scroll here(scroll down to where it says [Scroll]):

while($send_array = mysql_fetch_array($send_query)){
$send_eMail = $send_array['eMail'];
$employee_query = mysql_query("SELECT * FROM employee_info WHERE eMail='$send_eMail'");
$employee_array = mysql_fetch_array($employee_query);
$firstName = $employee_array['firstName'];
$lastName = $employee_array['lastName'];
$country = $employee_array['country'];
if($send_eMail != $eMail){
echo "
<tr>
<td style='padding-top: 10px'>
//--------------Scroll---------------//
<a href='profile.php?site=info&self=0&q=" . $send_eMail . "'>" . $firstName . " " . $lastName . "</a>
//--------------Scroll---------------//
</td>
</tr>";
}
}
 

Smith6612

I ate all of the x10Pizza
Community Support
Messages
6,517
Reaction score
48
Points
48
This looks more like PHP code to me than HTML. You might want to fix your topic name :)
 

Synkc

Active Member
Messages
1,765
Reaction score
0
Points
36
You could use: "<marquee></marquee>", <select><option/></select> (use in forms), or you could create an iframe.
 

nmunoz

New Member
Messages
5
Reaction score
0
Points
0
im using php, but the code im lookiing for is html. I have the PHP part covered I just need to know the html code to put a scroll.
Edit:
if I use an iframe would I have to put the code in a different file?
 
Last edited:

tgkprog

Member
Messages
226
Reaction score
0
Points
16
you can use a javascript timer and innerText
Code:
<html>
<head>
</head>
<body>

<div id="scoll1"> &nbsp;a </div >
static


<script>
var timeHandle = -1;
timeHandle = setTimeout("scrollFn()",500);//milliseconds
var iScrolPos = 0;
var  scrolTxt = "Ok this is what you will see scrolling - though is scrolling what u want? I dont like scrolls"
//alert(scoll1p = document.getElementById("scoll1"));
//alert(scoll1p.innerText  + " timeHandle " + timeHandle);

function scrollFn(){

	scoll1p = document.getElementById("scoll1");

	if(iScrolPos == scrolTxt.length )iScrolPos=0;
	//alert("a");
	scoll1p.innerText = scrolTxt.substring(iScrolPos++) + " " + scrolTxt.substring(0, iScrolPos) ;

	//alert(scoll1p.innerText  + " timeHandle " + timeHandle);

	//if(iScrolPos <4)
	timeHandle = setTimeout("scrollFn()",500);//milliseconds
}


function ClearScrollFn(){
if(timeHandle > 0)
	clearTimeout(timeHandle );
	timeHandle =0;
}
</script>
Edit:
i'm not calling ClearScrollFn but u can on a button click or after a set period

Code:
<html>
<head>
</head>
<body>

<div id="scoll1"> &nbsp;a </div >
static
<input type=button onclick="ClearScrollFn()" value="Stop">

<script>
var timeHandle = -1;
timeHandle = setTimeout("scrollFn()",500);//milliseconds
var iScrolPos = 0;
var  scrolTxt = "Ok this is what you will see scrolling - though is scrolling what u want? I dont like scrolls"
//alert(scoll1p = document.getElementById("scoll1"));
//alert(scoll1p.innerText  + " timeHandle " + timeHandle);

function scrollFn(){

	scoll1p = document.getElementById("scoll1");

	if(iScrolPos == scrolTxt.length )iScrolPos=0;
	//alert("a");
	scoll1p.innerText = scrolTxt.substring(iScrolPos++) + " " + scrolTxt.substring(0, iScrolPos) ;

	//alert(scoll1p.innerText  + " timeHandle " + timeHandle);

	//if(iScrolPos <4)
	timeHandle = setTimeout("scrollFn()",500);//milliseconds
}


function ClearScrollFn(){
if(timeHandle > 0){
	alert("c");
	clearTimeout(timeHandle );
	timeHandle =0;

	scoll1p = document.getElementById("scoll1");
	scoll1p.innerText = scrolTxt;
	}
}

/*
or u can have a seperate stopper timer

setTimeout("ClearScrollFn()",12500);//put this outside the comment

*/
</script>
 
Last edited:

Jober68

Member
Messages
63
Reaction score
0
Points
6
If I were you I'd use marque because it's a simple code and you can do a lot with it. It would also stand out from the PHP so if you ever need to go back to edit it you could find it easy.
 
Status
Not open for further replies.
Top