|
|
hallo, ich habe in meiner page (frameset) ein javascript "maustrailer" eingebaut und dazu eins , welches das gesamte frameset lädt bei aufruf einer Unterseite.
leider funktuioniert das Script für das Frameset nachladen nur ohne dem script maustrailer.
kann mir jemand evt einen rat geben , leider habe ich fast keine ahnung von javascript und bin froh zumindest die scripte einigermaßen anpassen zu können.
der maustrailer steht im body und der frameaufruf im headbereich mit onload im body.
vielen dank legolas
|
|
| 13.07.2007 03:08:09 |
|
dkdenz
Administrator
Ort: Lübeck
Registriert: 25.04.2005
Beiträge: 605
|
|
Hallo
Ohne Code und Quelltext? Wie soll das gelöst werden?
Vierl Spaß noch...
_______________________________________ Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.14eol) Gecko/20080418 Ubuntu/dapper-security Firefox/1.5.0.12eol
|
|
| 13.07.2007 09:17:02 |
| http://dkmd.de | http://dkdenz.de |
Zitieren |
|
|
|
ja, du hast recht, sorry,
hier der quelltext:
Code:
<html>
<head>
<title>titel</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
function FramesetTest() {
if (top.frames.length==0) {
Address=" f_set.html?main.html ";
if(document.images) top.location.replace(Address);
else top.location.href=Address;
}
}
//-->
</script>
<style type="text/css">
<!--
BODY {scrollbar-base-color: #006000}
-->
</style>
</head>
<body onLoad="FramesetTest()">
<script type="text/javascript">
// CREDITS:
// Cursor Trailer
// By Urs Dudli and Peter Gehrig
// Copyright (c) 2002 Peter Gehrig and Urs Dudli. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at http://www.24fun.com
// info@24fun.com
// 8/31/2002
// IMPORTANT:
// If you add this script to a script-library or script-archive
// you have to add a highly visible link to
// http://www.24fun.com on the webpage
// where this script will be featured
/////////////////////////////////////////////////////////////////////
// Unterhalb dieser zwei Linien beginnt die Editierzone
// Bestimmen Sie die Eigenschaften der Text-Animation
/////////////////////////////////////////////////////////////////////
// Tragen Sie Ihre Message ein (muss von Anführungszeichen umrahmt sein)
var text="text"
// Bestimmen Sie die Schriftart
var textfont="Arial"
// Bestimmen Sie die Schriftgrösse (CSS-Werte)
var textfontsize=10
// Bestimmen Sie die Schriftfarbe
var textfontcolor="#006000"
// Tragen Sie "bold" ein für fette Schrift oder "normal" für normale Schrift
var textweight="bold"
// Tragen Sie "italic" ein für kursive Schrift oder "normal" für normale Schrift
var textitalic="normal"
/////////////////////////////////////////////////////////////////////
// Hier endet die Editierzone
// Bitte ändern Sie den nachfolgenden Programmiercode nur,
// wenn Sie ein geübter JavaScripter sind.
/////////////////////////////////////////////////////////////////////
var trailertext=text+" "
trailertext=trailertext.split("")
var spanwidth=new Array()
var ns4=document.layers?1:0
var ns6=document.getElementById&&!document.all?1:0
var ie=document.all?1:0
var x,y
var flag=false
var step=20
var windowheight=100
var windowwidth=100
var xpos=new Array()
for (i=0;i<=trailertext.length-1;i++) {
xpos[i]=-50
}
var ypos=new Array()
for (i=0;i<=trailertext.length-1;i++) {
ypos[i]=-50
}
function handlerMM(e){
if (ns4 || ns6) {
x=e.pageX
y=e.pageY
}
if (ie) {
x=document.body.scrollLeft+event.clientX
y=document.body.scrollTop+event.clientY
}
flag=true
}
function getpagesize() {
if (ie) {
windowheight=parseInt(document.body.clientHeight)
windowwidth=parseInt(document.body.clientWidth)
}
if (ns4 || ns6) {
windowheight=parseInt(window.innerHeight)
windowwidth=parseInt(window.innerWidth)
}
makesnake()
}
function makesnake() {
if (flag&& ie) {
for (i=trailertext.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+spanwidth[i-1]
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<trailertext.length-1; i++) {
var thisspan=eval("document.all.span"+(i)+".style")
if (xpos[i]>(windowwidth-2*textfontsize)) {
xpos[i]=-2000
}
if (ypos[i]>((windowheight+document.body.scrollTop)-2*textfontsize)) {
ypos[i]=-2000
}
thisspan.posLeft=xpos[i]
thisspan.posTop=ypos[i]
}
}
if (flag&& ns6) {
for (i=trailertext.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+spanwidth[i-1]
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<trailertext.length-1; i++) {
var thisspan=eval("document.getElementById('span"+i+"').style")
if (xpos[i]>(windowwidth-2*textfontsize)) {
xpos[i]=-2000
}
thisspan.left=xpos[i]
thisspan.top=ypos[i]
}
}
if (flag&& ns4) {
for (i=trailertext.length-1; i>=1; i--) {
xpos[i]=xpos[i-1]+spanwidth[i-1]
ypos[i]=ypos[i-1]
}
xpos[0]=x+step
ypos[0]=y
for (i=0; i<trailertext.length-1; i++) {
var thisspan = eval("document.span"+i)
thisspan.left=parseInt(xpos[i])
thisspan.top=parseInt(ypos[i])
}
}
var timer=setTimeout("makesnake()",10)
}
if (ie || ns6 || ns4) {
document.write("<STYLE>")
document.write(".spanstyle {")
document.write("position:absolute;")
document.write("visibility:visible;")
document.write("top:-100px;")
document.write("left:-100px;")
document.write("font-family:"+textfont+";")
document.write("color:"+textfontcolor+";")
document.write("font-size:"+textfontsize+"pt;")
document.write("font-weight:"+textweight+";")
document.write("font-style:"+textitalic+";")
document.write("}")
document.write("</STYLE>")
for (i=0;i<=trailertext.length-1;i++) {
document.write("<span id='span"+i+"' class='spanstyle'>")
document.write(trailertext[i])
document.write("</span>")
if (ie) {
var thisspan=eval("document.all.span"+i)
spanwidth[i]=Math.round(parseInt(thisspan.offsetWidth))
if (spanwidth[i]==0) {spanwidth[i]=textfontsize}
}
if (ns6) {
var thisspan=eval("document.getElementById('span"+i+"')")
spanwidth[i]=Math.round(parseInt(thisspan.offsetWidth))
if (spanwidth[i]==0) {spanwidth[i]=textfontsize}
}
if (ns4) {
var thisspan=eval("document.span"+i+".document")
spanwidth[i]=Math.round(thisspan.width)
if (spanwidth[i]==0) {spanwidth[i]=textfontsize}
thisspan.clear()
}
}
}
if (ns4){
document.captureEvents(Event.MOUSEMOVE);
}
if (ie || ns6 || ns4) {
document.onmousemove = handlerMM;
window.onload=getpagesize
}
</script>
</body>
</html> |
wenn icgh das script für den cursor trailer entferne funktioniert der Frameaufruf, ansonsten leider nicht und ich weiß nicht warum.
|
|
| 13.07.2007 14:55:06 |
|
|
|
Ganz einfach, das Trailerscript überschreibt den onload-Eventhandler, der FramesetTest() aufruft, mit der eigenen Funktion getpagesize(). Zur Abhilfe muss man einfach den Code von FramesetTest() nochmal zur Funktion getpagesize() hinzufügen, also so:
(Zeile 107) function getpagesize() { /* Dein Code */ if (top.frames.length==0) { Address=" f_set.html?main.html "; if(document.images) top.location.replace(Address); else top.location.href=Address; /* Hier gehts normal weiter */ if (ie) {
usw.
Gruß, blind-fish
|
|
| 15.07.2007 17:31:24 |
|
|
|
ich danke dir für deine Hilfee, freu....... ich werds nachher gleich ausprobieren.
vielen dank legolas
|
|
| 15.07.2007 19:54:38 |
|
Wechsel zu
Die letzten Beiträge aus diesen Forum
|
|