...

View Full Version : Ebay custom page script



TinMan
08-09-2006, 06:04 PM
I found this script that i wanted to use on some e bay listings.
But e bay tell me

Your listing cannot contain javascript (".cookie", "cookie(", "replace(", IFRAME, META, or includes), cookies or base href.

Now I know you can use javascript, but obviously something in the code is bothering them. Code is not mine it is from javafile.com

Can you advise on possible solutions as I am not a javascript expert.
Thanks
The code is:-

____________________________________________________________


PASTE THIS SCRIPT INTO YOUR BODY TAG

<style type="text/css">
<!--
.textanimlink,a {
text-decoration : none;
}
P.main {
font-family : Arial;
font-size : 15pt;
font-weight : bold;
}
-->
</style>


<Script Language="Javascript">
<!-- Hiding

/*
Script created by Lefteris Haritou
(lef@the.forthnet.gr)
*/

bname=navigator.appName;
bversion=parseInt(navigator.appVersion)
if ((bname=="Netscape" && bversion>=4) || (bname=="Microsoft Internet Explorer" && bversion>=4))
window.onload=start
else
stop();
window.onunload=stop
if (bname=="Netscape"){
brows=true
dt=2
}
else{
brows=false
dt=20
}
var z=0;
var msg=0;
var rgb=0;
var link=false;
var status=true;
var updwn=false;
var message= new Array();
var value=0;
var h=window.innerHeight;
var w=window.innerWidth;
var timer1;
var timer2;
var timer3;
var convert = new Array()
var hexbase= new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F");

// Put here your own messages. Add as many as you wan't (Do not edit anything else in the Script except the lines below)

var bgcolor="#FFFFFF"; //Color of background
var color="#00008D"; //Color of the Letters

message[0]='The future of JavaScript'
message[1]='Today.'
message[2]='Javafile.com code library'
message[3]='<a href="http://www.javafile.com">Click here to begin THE experience</a>'

// Put here your own messages. Add as many as you wan't (Do not edit anything else in the Script except the lines above)

for (x=0; x<16; x++){
for (y=0; y<16; y++){
convert[value]= hexbase[x] + hexbase[y];
value++;
}
}

redx=color.substring(1,3);
greenx=color.substring(3,5);
bluex=color.substring(5,7);
hred=eval(parseInt(redx,16));
hgreen=eval(parseInt(greenx,16));
hblue=eval(parseInt(bluex,16));
eredx=bgcolor.substring(1,3);
egreenx=bgcolor.substring(3,5);
ebluex=bgcolor.substring(5,7);
ered=eval(parseInt(eredx,16));
egreen=eval(parseInt(egreenx,16));
eblue=eval(parseInt(ebluex,16));
red=ered;
green=egreen;
blue=eblue;

function start(){
if ((bname=="Netscape" && bversion>=4) || (bname=="Microsoft Internet Explorer" && bversion>=4)){
link=false;
updwn=true;
if (brows)
res=document.layers['textanim'].top
else{
textanim.style.width=document.body.offsetWidth-20;
textanim.innerHTML='<Pre><P Class="main" Align="Center">'+message[msg]+'</P></Pre>'
res=textanim.style.top
for (x=0; x<document.all.length; x++)
if(document.all[x].id=="textanimlink")
link=true;
}
up()
}
}

function stop(){
clearTimeout(timer1);
clearTimeout(timer2);
clearTimeout(timer3);
}

function resz(){
h=window.innerHeight;
w=window.innerWidth;
if (updwn)
timer1=setTimeout('up()',1000)
else
timer2=setTimeout('down()',1000)
}

function breakf(){
if (status){
clearTimeout(timer1);
clearTimeout(timer2);
status=false
return;
}
else{
status=true;
if (updwn)
timer1=setTimeout('up()',dt)
else
timer2=setTimeout('down()',dt)
}
}


function up(){
if (red<hred){
if ((red+7)<hred)
red+=7;
else
red=hred
redx = convert[red]
}
else{
if ((red-7)>hred)
red-=7;
else
red=hred
redx = convert[red]
}

if (green<hgreen){
if ((green+7)<hgreen)
green+=7;
else
green=hgreen
greenx = convert[green]
}
else{
if ((green-7)>hgreen)
green-=7;
else
green=hgreen
greenx = convert[green]
}

if (blue<hblue){
if ((blue+7)<hblue)
blue+=7;
else
blue=hblue
bluex = convert[blue]
}
else{
if ((blue-7)>hblue)
blue-=7;
else
blue=hblue
bluex = convert[blue]
}

rgb = "#"+redx+greenx+bluex;
if (brows){
document.layers['textanim'].document.linkColor=rgb;
document.layers['textanim'].document.vlinkColor=rgb;
if (window.innerHeight!=h || window.innerWidth!=w){
clearTimeout(timer1);
resz()
return;
}
else{
document.layers['textanim'].document.write('<Pre><P Class="main" Align="Center"><font color="'+rgb+'">'+message[msg]+'</font></P></Pre>')
document.layers['textanim'].document.close();
}
}
else{
textanim.style.color=rgb;
if(link)
textanimlink.style.color=rgb;
}
if (z<38){
if (brows)
document.layers['textanim'].top--
else
textanim.style.posTop--
z++
timer1=setTimeout('up()',dt)
}
else
{
updwn=false;
down()
}
}


function down(){
if (red<ered){
if ((red+7)<ered)
red+=7;
else
red=ered
redx = convert[red]
}
else{
if ((red-7)>ered)
red-=7;
else
red=ered
redx = convert[red]
}

if (green<egreen){
if ((green+7)<egreen)
green+=7;
else
green=egreen
greenx = convert[green]
}
else{
if ((green-7)>egreen)
green-=7;
else
green=egreen
greenx = convert[green]
}

if (blue<eblue){
if ((blue+7)<eblue)
blue+=7;
else
blue=eblue
bluex = convert[blue]
}
else{
if ((blue-7)>eblue)
blue-=7;
else
blue=eblue
bluex = convert[blue]
}

rgb = "#"+redx+greenx+bluex;
if (brows){
document.layers['textanim'].document.linkColor=rgb;
document.layers['textanim'].document.vlinkColor=rgb;
if (window.innerHeight!=h || window.innerWidth!=w){
clearTimeout(timer2);
resz()
return;
}
else{
document.layers['textanim'].document.write('<Pre><P Class="main" Align="Center"><font color="'+rgb+'">'+message[msg]+'</font></P></Pre>')
document.layers['textanim'].document.close();
}
}
else{
textanim.style.color=rgb;
if(link)
textanimlink.style.color=rgb;
}

if (z<76){
if (brows)
document.layers['textanim'].top--
else
textanim.style.posTop--
z++
timer2=setTimeout('down()',dt)
}
else
{
if (brows){
document.layers['textanim'].document.write('')
document.layers['textanim'].document.close();
}
else
textanim.innerHTML='';
window.clearInterval(timer2);
if(msg<message.length-1){
msg++;
z=0;
if (brows){
document.layers['textanim'].top=res;
}
else
textanim.style.top=res;
timer3=setTimeout('start()',100);
}
else
{
msg=0;
z=0;
if (brows)
document.layers['textanim'].top=res;
else
textanim.style.top=res;
timer3=setTimeout('start()',2000);
}
}
}


// done hiding -->
</Script>
<Div id="textanim" style="position: absolute; left: 0; top: 440" onclick="breakf()">
</Div>
<Layer name="textanim" left=0 top=440>
</Layer>

Rappa
08-09-2006, 09:26 PM
put code in code tags

TinMan
08-09-2006, 09:31 PM
Amended

TinMan
08-14-2006, 08:18 PM
If this script cannot be amended, can anyone direct to a similar one?

This one scrolls several lines of text vertically, fading them out as they reach the top.

Thanks

vwphillips
08-15-2006, 01:58 AM
bit rough at the moment but


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
// by Vic Phillips (17-August-2006) - http://www.vicsjavascripts.org.uk
// DRAFT

var zxcColAry,zxcColAry1;
var top=0;

function zxcInit(zxcid,zxcccol,zxcbgcol){
var zxcp=document.getElementById(zxcid);
var zxchtml=zxcp.getElementsByTagName('A');
var zxcary=[];
var zxcd=zxcStyle('DIV',{position:'relative',left:'0px',top:'0px'});
var zxccnt=0
for (var zxc0=0;zxc0<zxchtml.length*5;zxc0++){
zxcary[zxc0]=zxcStyle('DIV',{position:'relative',fontSize:'30px',color:zxcccol[0],backgroundColor:zxcbgcol[0]},zxchtml[zxccnt=++zxccnt%zxchtml.length].firstChild.data);
zxcd.appendChild(zxcary[zxc0]);
}
zxcp.innerHTML='';
zxcp.appendChild(zxcd);
zxcp.d=zxcd;
zxcp.ary=zxcary;
zxcColAry=zxcGradientColors(zxcccol);
zxcColAry1=zxcGradientColors(zxcbgcol);
zxcRotate();
}

function zxcRotate(){
var zxcp=document.getElementById('Tst1');
if (zxcp.scrollTop>zxcp.scrollHeight-zxcp.offsetHeight){ top=0; }
zxcp.scrollTop=(top++);
for (var zxc0=0;zxc0<zxcp.ary.length;zxc0++){
var zxcpos=zxcp.ary[zxc0].offsetTop-zxcp.scrollTop;
if (zxcpos>=0&&zxcpos<100){
zxcp.ary[zxc0].style.backgroundColor=zxcColAry1[zxcpos];
zxcp.ary[zxc0].style.color=zxcColAry[zxcpos];
}
}
setTimeout('zxcRotate()',10);
}

function zxcStyle(zxcele,zxcstyle,zxctxt){
if (typeof(zxcele)=='string'){ zxcele=document.createElement(zxcele); }
for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
if (zxctxt){ zxcele.appendChild(document.createTextNode(zxctxt)); }
return zxcele;
}


function zxcGradientColors(zxcc){
var zxcary=[];
zxcc1=zxcc[0].replace('#',''); zxcc2=zxcc[1].replace('#','');
var zxcr=zxcHexToInt(zxcc1.substring(0,2));
var zxcg=zxcHexToInt(zxcc1.substring(2,4));
var zxcb=zxcHexToInt(zxcc1.substring(4,6));
var zxcr2=zxcHexToInt(zxcc2.substring(0,2));
var zxcg2=zxcHexToInt(zxcc2.substring(2,4));
var zxcb2=zxcHexToInt(zxcc2.substring(4,6));
var zxcrstep=Math.round((zxcr2-zxcr)/101);
var zxcgstep=Math.round((zxcg2-zxcg)/101);
var zxcbstep=Math.round((zxcb2-zxcb)/101);
for (zxc0=0;zxc0<100;zxc0++){
zxcary[zxc0]="#"+zxcIntToHex(zxcr)+zxcIntToHex(zxcg)+zxcIntToHex(zxcb);
zxcr+=zxcrstep; zxcg+=zxcgstep; zxcb+=zxcbstep;
}
zxcary[99]='#'+zxcc2;
return zxcary;
}

function zxcIntToHex(zxcn){
if (zxcn>255){ zxcn=255; }
var zxcresult=zxcn.toString(16);
if (zxcresult.length==1){ zxcresult="0"+zxcresult; }
return zxcresult;
}

function zxcHexToInt(zxchex){
return parseInt(zxchex,16);
}


//-->
</script>
</head>

<body onload="zxcInit('Tst1',['#FFFFCC','#FFCC66'],['#CCFF66','#003300']);">
<div id="Tst1" style="position:relative;overflow:hidden;width:400px;height:100px;border:solid black 1px;" >
<a>Line 1</a><br>
<a>Line 2</a><br>
<a>Line 3</a><br>
<a>Line 4</a><br>
<a>Line 5</a><br>
<a>Line 6</a><br>
<a>Line 7</a><br>

</div>
</body>

</html>

TinMan
08-15-2006, 01:36 PM
Thanks, that would probably do,
except that e bay dont give you the option to place part in the head and part in the body, but I'll have a play with it anyway and see what happens.

thx

vwphillips
08-15-2006, 02:00 PM
latest


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
// by Vic Phillips (15-August-2006) - http://www.vicsjavascripts.org.uk


function zxcSTxtChange(zxcid,zxcdir,zxcdly){
var zxcoop=window['zxcSTzt'+zxcid];
if (!zxcoop){ return; }
clearTimeout(zxcoop.to);
zxcdir=zxcdir||0;
zxcoop.d=zxcdir||zxcoop.d;
zxcoop.dly=zxcdly||zxcoop.dly;
if (zxcdir!=0){ zxcoop.setTimeOut('rotate();',100); }
}

function zxcInit(zxcid,zxcccol,zxcbgcol,zxcdir,zxcdly){
var zxcp=document.getElementById(zxcid);
if (zxcp){ window['zxcSTzt'+zxcid]=new zxcOOPSTxt(zxcp,zxcccol,zxcbgcol,zxcdir,zxcdly); }
}

function zxcOOPSTxt(zxcp,zxcccol,zxcbgcol,zxcdir,zxcdly){
this.p=zxcp;
var zxchtml=this.p.getElementsByTagName('A');
this.ary=[];
var zxcd=zxcStyle('DIV',{position:'absolute',left:'0px',top:'0px',width:'100%'});
var zxccnt=0
var zxcrary=[];
for (var zxc0=0;zxc0<zxchtml.length*3;zxc0++){
this.ary[zxc0]=zxcStyle('DIV',{position:'relative',color:zxcccol[0],backgroundColor:zxcbgcol[0]});
zxcd.appendChild(this.ary[zxc0]);
this.ary[zxc0].appendChild(zxchtml[zxccnt=++zxccnt%zxchtml.length].cloneNode(true));
if (zxc0<zxchtml.length){ zxcrary.push(zxchtml[zxc0]); }
}
for (var zxc1=0;zxc1<zxcrary.length;zxc1++){ zxcp.removeChild(zxcrary[zxc1]); }
this.p.appendChild(zxcd);
this.col=[zxcSTxtColors(zxcccol,100),zxcSTxtColors(zxcbgcol,100)];
this.sz=this.ary[zxc0-1].offsetTop-this.p.offsetHeight;
this.ref='zxcoopstxt'+zxcp.id;
window[this.ref]=this;
this.to=null;
this.top=0;
this.d=zxcdir||1;
this.dly=zxcdly||10;
this.rotate();
}

zxcOOPSTxt.prototype.rotate=function(){
if ((this.d>0&&this.p.scrollTop>this.sz)){ this.top=0; }
if ((this.d<0&&this.p.scrollTop<=0)){ this.top=this.sz; }
this.p.scrollTop=(this.top+=this.d);
for (var zxc0=0;zxc0<this.ary.length;zxc0++){
var zxcpos=Math.floor((this.ary[zxc0].offsetTop-this.p.scrollTop)*100/this.p.offsetHeight);
this.ary[zxc0].style.color='#'+this.col[0][0];
this.ary[zxc0].style.backgroundColor='#'+this.col[1][0];
if (zxcpos>=0&&zxcpos<=100){
this.ary[zxc0].style.color='#'+(this.col[0][zxcpos]||this.col[0][0]);;
this.ary[zxc0].style.backgroundColor='#'+(this.col[1][zxcpos]||this.col[1][0]);
}
}
this.setTimeOut('rotate();',this.dly);
}

zxcOOPSTxt.prototype.setTimeOut=function(zxcf,zxcd){
this.to=setTimeout('window.'+this.ref+'.'+zxcf,zxcd);
}

function zxcStyle(zxcele,zxcstyle){
if (typeof(zxcele)=='string'){ zxcele=document.createElement(zxcele); }
for (key in zxcstyle){ zxcele.style[key]=zxcstyle[key]; }
return zxcele;
}

function zxcSTxtColors(zxcc,zxcnu){
var zxcary=[];
zxcc1=zxcc[0].replace('#',''); zxcc2=zxcc[1].replace('#','');
var zxcr=zxcHexToInt(zxcc1.substring(0,2));
var zxcg=zxcHexToInt(zxcc1.substring(2,4));
var zxcb=zxcHexToInt(zxcc1.substring(4,6));
var zxcr2=zxcHexToInt(zxcc2.substring(0,2));
var zxcg2=zxcHexToInt(zxcc2.substring(2,4));
var zxcb2=zxcHexToInt(zxcc2.substring(4,6));
var zxcrstep=Math.round((zxcr2-zxcr)/zxcnu);
var zxcgstep=Math.round((zxcg2-zxcg)/zxcnu);
var zxcbstep=Math.round((zxcb2-zxcb)/zxcnu);
for (zxc0=0;zxc0<zxcnu;zxc0++){
zxcary[zxc0]=zxcIntToHex(zxcr)+zxcIntToHex(zxcg)+zxcIntToHex(zxcb);
zxcr+=zxcrstep; zxcg+=zxcgstep; zxcb+=zxcbstep;
}
zxcary[zxcnu-1]=zxcc[1].substring(1);
return zxcary;
}

function zxcIntToHex(zxcn){
zxcn=(zxcn>255)?255:(zxcn<0)?0:zxcn;
var zxcresult=zxcn.toString(16);
if (zxcresult.length==1){ zxcresult="0"+zxcresult; }
return zxcresult;
}

function zxcHexToInt(zxchex){
return parseInt(zxchex,16);
}


//-->
</script>
</head>

<body onload="zxcInit('Tst1',['#FFFFCC','#FFCC66'],['#CCFF66','#003300']);zxcInit('Tst2',['#FFFFCC','#FFCC66'],['#CCFFFF','#990000']);">
<div id="Tst1" style="position:relative;overflow:hidden;width:400px;height:100px;border:solid black 1px;text-align:center;"
onmouseover="zxcSTxtChange('Tst1',0);"
onmouseout="zxcSTxtChange('Tst1',1);"
>
<a style="font-size:20px;" >Line 1</a><br>
<a>Line 2</a><br>
<a>Line 3</a><br>
<a>Line 4</a><br>
<a>Line 5</a><br>
<a>Line 6</a><br>
<a>Line 7</a><br>

</div>
<input type="button" name="" value="Change" onclick="zxcSTxtChange('Tst1',-1);">
<input type="button" name="" value="Change" onclick="zxcSTxtChange('Tst1',1);">
<input type="button" name="" value="Change" onclick="zxcSTxtChange('Tst1',0);">

<div id="Tst2" style="position:relative;overflow:hidden;width:600px;height:200px;border:solid black 1px;text-align:center;"
onmouseover="zxcSTxtChange('Tst2',0);"
onmouseout="zxcSTxtChange('Tst2',1);"
>
<a style="font-size:20px;" >Line 1</a><br>
<a>Line 2</a><br>
<a>Line 3</a><br>
<a>Line 4</a><br>
<a>Line 5</a><br>
<a>Line 6</a><br>
<a>Line 7</a><br>

</div>
</body>

</html>

TinMan
08-15-2006, 06:23 PM
Great thankyou,

I think I can get this to work, there is a flicker but I need to check any tweaks I have done havent caused this..

Which parameter controls the speed?

thx



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum