Homepage selbermachen 7.851 Themen, 35.615 Beiträge

HILFE!!!!! Text animieren!

Berki / 2 Antworten / Flachansicht Nickles

Hi!

Ich möchte gerne einen Text auf meiner Homepage animieren, so was ähnliches wie eine Diashow, nur mit reinen Text eben. Ich besitze Dreamweaver und GoLive.
Kann ich das mit diesen Progs oder brauch ich da n anderes? Welches?
Und WIE machen?

BITTE, BITTE, helft mir!!!!!!!!!!!

Tausend Dank!

bei Antwort benachrichtigen
Heinz_Malcher Berki „HILFE!!!!! Text animieren!“
Optionen

das kannst du mit ganz einfachem DHTML machen ...z.b.:

<html>
<BODY TEXT="#FFFFFF" BGCOLOR="#000000" onload="init()">
<A HREF="zoom.zip"><IMG SRC="download.gif" border=0></A>
<Center>
<script>
text = new Array("visit","my","home" , "page", "visit my home page");
var numText = 5;
color = new Array("red" , "orange" , "yellow" , "green" , "blue" , "indigo" , "violet" , "darkorange");
var numColors = 8;
var endSize = 48;
var Zspeed = 60;
var Cspeed = 60;
var font = 'Arial Black';
var hide = false;
var size = 10;
var gonum = 0;
if (document.all) {
n = 0;
ie = 1;
zoomText = "document.all.zoom.innerText=text[num]";
zoomSize = 'document.all.zoom.style.fontSize=size';
closeIt = "";
fadeColor = "document.all.zoom.style.color=color[num]";
}
if (document.layers) {
n = 1;
ie = 0;
zoomText = "";
zoomSize = "document.zoom.document.write('<p align=\"center\" style=\"font-family:'+font+'; font-size:'+size+'px; color:'+color[0]+'\">'+text[num]+'</p>')";
closeIt = "document.zoom.document.close()";
fadeColor = "document.zoom.document.write('<p align=\"center\" style=\"font-family:'+font+'; font-size:'+endSize+'px; color:'+color[num]+'\">'+text[numText-1]+'</p>')";
}
function zoom(num,fn){
if (size<endSize){
eval(zoomText)
eval(zoomSize)
eval(closeIt)
size+=5;
setTimeout("zoom("+num+",'"+fn+"')",Zspeed)
}else{
eval(fn);
}
}
function fadeIt(num){
if (num<numColors){
eval(fadeColor)
eval(closeIt)
num+=1;
setTimeout("fadeIt("+num+")",Cspeed)
}else{
hideIt()
}
}
function hideIt(){
if(hide){
if(ie)document.all.zoom.style.visibility="hidden"
if(n)document.layers.zoom.visibility="hidden"
}
}
function init(){
if(ie){
document.all.zoom.style.color=color[0]
document.all.zoom.style.fontFamily=font}
go(0)
}
function go(num){
gonum+=1
size=10
if(num<numText){
zoom(num,'go('+gonum+')')
}else{
fadeIt(0)
}
}
</script>
<STYLE>
<!--
.link {
color : blue;
font-weight : bold;
text-decoration : none;
}
A.link:hover {
color : aqua;
}
A.link:active {
color : greenyellow;
text-decoration : none;
text-transform : uppercase;
}
//-->
</STYLE>
</HEAD>
<div id="zoom" align="center" style="position:absolute; top:150"></div>
<div id="Main" style="position:absolute; width:150; top:30; font-family:verdana; font-size:12px; color:white;">
</DIV>
</div>
</center>
</BODY>
</HTML>


oder






<html>
<head>
<title>Quotation Scroller</title>




<script language="JavaScript1.2">
<!-- // Hide

// *** COMMON CROSS-BROWSER COMPATIBILITY CODE ***

// You'll need to edit this section if combining with any of my other scripts, make sure
// everything is included once.

var isDOM = document.getElementById?1:0;
var isIE = document.all?1:0;
var isNS4 = (navigator.appName=='Netscape'&&!isDOM)?1:0;
var isIE4 = (isIE&&!isDOM)?1:0;
var isDyn = (isDOM||isIE4||isNS4);

function getRef(id, par)
{
par = (!par ? document : (par.navigator ? par.document : par));
return (isIE ? par.all[id] :
(isDOM ? (par.getElementById?par:par.ownerDocument).getElementById(id) :
par.layers[id]));
}

function getSty(id, par)
{
return (isNS4 ? getRef(id, par) : getRef(id, par).style)
}

if (!window.LayerObj) var LayerObj = new Function('id', 'par',
'this.ref=getRef(id, par); this.sty=getSty(id, par); return this');
function getLyr(id, par) { return new LayerObj(id, par) }

function LyrFn(fn, fc)
{
LayerObj.prototype[fn] = new Function('var a=arguments,p=a[0]; with (this) { '+fc+' }');
}
LyrFn('x','if (!isNaN(a[0])) sty.left=p; else return parseInt(sty.left)');
LyrFn('y','if (!isNaN(a[0])) sty.top=p; else return parseInt(sty.top)');
LyrFn('w','if (p) (isNS4?sty.clip:sty).width=p; ' +
'else return (isNS4?ref.document.width:ref.offsetWidth)');
LyrFn('vis','sty.visibility=p');
LyrFn('write','if (isNS4) with (ref.document) {write(p);close()} else ref.innerHTML=p');

if (!window.page) var page = { win: window, minW: 0, minH: 0, MS: isIE&&!window.opera }

page.winW=function()
{ with (this) return Math.max(minW, MS?win.document.body.clientWidth:win.innerWidth) }
page.winH=function()
{ with (this) return Math.max(minH, MS?win.document.body.clientHeight:win.innerHeight) }



// *** QUOTATION SCROLLER ENGINE ***

function checkDivs()
{
if (!isDyn) return;

for (var i = 1; i <= visQuotes; i++)
{
// Get a layer object if it doesn't exist, and work with it.
if (!sDivs[i])
{
sDivs[i] = getLyr('sDiv' + i);
// IE4, as normal, has horrible width bugs in which content expands to fill the screen.
if (isIE4) sDivs[i].w(10);
}

with (sDivs[i])
{
// If it's moved offscreen to the left (or starting), set things in motion...
if (x() < (0 - w()))
{
// Scrolling increment varies from 8 to 63.
speed[i] = Math.floor(Math.random() * 56) + 8;
// Off to the right it goes -- qPos records the current position as a floating point number.
qPos[i] = page.winW() + 50*Math.random();

// Position and layer it according to its speed (faster = higher).
var topMax = page.winH() - speed[i];
y(topMax * Math.random());
sty.zIndex = speed[i];

// Write a quote in a colour that depends on the speed.
// You might want to edit this to change the font etc, or perhaps make it a link?
var fontSize = Math.floor(speed[i] / 8) - 1;
write('<nobr><font face="Arial, Helvetica" size="' + fontSize + '" color="#' +
colours[fontSize] + '">' + quotes[Math.floor(Math.random() * quotes.length)] +
'</font></nobr>');
}

// All items: Keep 'em moving left.
qPos[i] -= (speed[i] / 4);
x(qPos[i]);
}
}

// Again!
setTimeout('checkDivs()', 50);
}










// *** START EDITING HERE ***


// There's more Simpsons at http://www.everything2.com/index.pl?node_id=767744
// Just cut and paste your quotes into this array:

var quotes = new Array(); c = 0;
quotes[c] = 'I will not instigate revolution'; c++;
quotes[c] = 'Garlic gum is not funny'; c++;
quotes[c] = 'They are laughing at me, not with me'; c++;
quotes[c] = 'I will not yell "Fire!" in a crowded classroom'; c++;
quotes[c] = 'I will not encourage others to fly'; c++;
quotes[c] = 'I will not drive the principal\'s car'; c++;
quotes[c] = 'I will not pledge allegiance to Bart'; c++;
quotes[c] = 'I will not belch the National Anthem'; c++;
quotes[c] = 'I will not sell land in Florida'; c++;
quotes[c] = 'I will not sleep through my education'; c++;
quotes[c] = 'I will finish what I sta...'; c++;
quotes[c] = 'I will not torment the emotionally frail'; c++;
quotes[c] = 'I will not spin the turtle'; c++;
quotes[c] = 'My name is not Dr. Death'; c++;
quotes[c] = 'A burp is not an answer'; c++;
quotes[c] = 'I will not yell "she\'s dead" during roll call'; c++;
quotes[c] = 'The principal\'s toupee is not a frisbee'; c++;
quotes[c] = 'Goldfish don\'t bounce'; c++;
quotes[c] = 'Mud is not one of the 4 food groups'; c++;
quotes[c] = 'I will not sell miracle cures'; c++;
quotes[c] = 'I will not charge admission to the bathroom'; c++;
quotes[c] = 'Organ transplants are best left to the professionals'; c++;


// Maximum onscreen at once, also number of DIVs in body -- change that too!
var visQuotes = 10;

// Just leave these, some global arrays are needed to remember quote details.
var sDivs = new Array(visQuotes);
var speed = new Array(visQuotes);
var qPos = new Array(visQuotes);

// Left: Low speed colours (lighter) .... Right: High speed colours (darker).
var colours = new Array('B2C7DE','A4BCD8','96B2D2','88A8CC','7A9EC6','6C94C0','5E89BA');



// Finally trigger quotation scrolling on page load.
// Remember to call all onLoad events here somehow (e.g. popup menus/other scripts)...
window.onload = new Function('checkDivs()');

// End Hide -->
</script>
</head>

<body bgcolor="#FFFFFF" scroll="no">

<!-- Have a list of numbered divs up to visQuotes -->
<div id="sDiv1" style="position: absolute; left: -1000"></div>
<div id="sDiv2" style="position: absolute; left: -1000"></div>
<div id="sDiv3" style="position: absolute; left: -1000"></div>
<div id="sDiv4" style="position: absolute; left: -1000"></div>
<div id="sDiv5" style="position: absolute; left: -1000"></div>
<div id="sDiv6" style="position: absolute; left: -1000"></div>
<div id="sDiv7" style="position: absolute; left: -1000"></div>
<div id="sDiv8" style="position: absolute; left: -1000"></div>
<div id="sDiv9" style="position: absolute; left: -1000"></div>
<div id="sDiv10" style="position: absolute; left: -1000"></div>

<div style="position: absolute; left: 100; top: 200; z-index: 100">
<h2>Where would we be without the Simpsons? :)</h2></div>

</body>
</html>
bei Antwort benachrichtigen