Mal ne frage ich möchte ein Html script einsetzen (kennt ihr bestimmt) wenn ich runterscrolle das da eine grafik auf einer stelle immer bleibt!
Hier ist dieser script:
<html>
<BODY onload="init()">
<Script language="Javascript">
<!--
var w = 170;
var h = 70;
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;
function makeObj(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')
this.evnt=(n)? eval(nest+'document.'+obj):eval(obj);
this.moveIt=b_moveIt;}
function b_moveIt(x,y){
this.x=x; this.y=y
this.css.left=this.x
this.css.top=this.y}
var pageWidth,pageHeight
function init(){
oTest=new makeObj('divBottom')
pageWidth=(ie)?document.body.offsetWidth-4:innerWidth;
pageHeight=(ie)?document.body.offsetHeight-2:innerHeight;
checkIt()
if(ie) window.onscroll=checkIt;}
function f(){alert(f)}
function checkIt(){
if(ie) oTest.moveIt(document.body.scrollLeft+pageWidth-w,document.body.scrollTop+pageHeight-h)
else if(n){oTest.moveIt(window.pageXOffset+pageWidth-w, window.pageYOffset+pageHeight-h)
setTimeout('checkIt()',20)}}
//-->
</script>
<style>
<!--
#divBottom{color:blue;}
//-->
</style>
<div id="divBottom" style="position:Absolute;width:40;height:20"><img src="images/icons/icon_rolleyes.gif" border=0</div> <BR> </body></html>
Nur die Frage in welche Datei füge ich es ein??? in header.php , theme.php oder wo???
Hi A-L-E-X :)
den <S c r i p t> Tag stellst Du komplett in die /includes/myheader.php
den <style> Tag ebenfalls
der Teil des body-Tags ( onload="init()" ) fügst Du dem body-Tag in Deiner theme.php hinzu
und den <DIV> Tag schreibst Du darunter
ok perfekt wollen wir dann mal nachgucken!
yep, mach mal,
natürlich ohne Garantie ;) ;)
PHP, Nuke und JavaScript - drei Welten treffen aufeinander... ;)
Ich hab gestern wieder mal 2 1/2 h am Einbau eines winzigen PopUp-Scriptes gesessen...grummel
ja hmm.. kriege diesen verdammten <div id="divBottom" style="position:Absolute;width:40;height:20"><img src="images/icons/icon_rolleyes.gif" border=0</div>
in die theme.php nicht hin!!! wo genau soll er denn stehen???
und ausserdem muss er ja anders geschrieben werden oder nicht!
<div id=\"divBottom\" style=\"position:Absolute;width:40;....???
so oder?
yep, die Schreibweise so wie Du geschrieben hast, die Anführungszeichen mit backslash davor ;)
Der body-tag befindet sich in der theme.php in der Funktion themeheader()
Die Zeile darunter sollte das div-Tag stehen.
Jetzt kommt es auf das theme an, wie es gecodet ist.....
Evtl. poste mal die paar Zeilen rund um den body-tag.
@ Joschau,
da haste recht.... :mad:
Also hier ist der originale code:
/************************************************************/
/* Function themeheader() */
/* */
/* Control the header for your site. You need to define the */
/* BODY tag and in some part of the code call the blocks */
/* function for left side with: blocks(left); */
/************************************************************/
function themeheader() {
global $user, $banners, $sitename, $slogan, $cookie, $prefix;
cookiedecode($user);
$username = $cookie[1]; if ($username == "") {
$username = "Anonymous";
}
echo "<body bgcolor=\"#DEDEE6\" text=\"\" link=\"\" vlink=\"\" alink=\"\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n"
."<p align=\"center\"><img src=\"themes/BlueBump_jogi24/images/test.jpg\" width=\"999\" height=\"100\">\n"
."<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\" bgcolor=\"#7373A4\" background=\"themes/BlueBump_jogi24/images/headerline.gif\" height=\"30\"><tr valign=\"middle\"><td><IMG src=\"themes/BlueBump_jogi24/images/pixel.gif\" width=\"24\" height=\"30\" border=\"0\" hspace=\"0\"></td><td><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" background=\"themes/BlueBump_jogi24/images/toplight_bg.gif\"><tr><td width=\"4\" height=\"30\"><img src=\"themes/BlueBump_jogi24/images/toplight_left.gif\" width=\"4\" height=\"30\"></td>\n"
."<td nowrap class=\"artsubhead\" align=\"left\">\n";
if ($username == "Anonymous") {
echo "<a href=\"modules.php?name=Your_Account\">Login/Erstelle</a> dein
Account\n | ";
} else {
echo " Willkommen $username! | <a href=\"modules.php?name=Your_Account&op=logout\">logout</a> | ";
}
echo "<script type=\"text/javascript\">\n"
."<!-- // Array ofmonth Names\n"
."var monthNames = new Array( \"Januar\",\"Februar\",\"März\",\"April\",\"Mai\",\"Juni\",\"Juli\",\"August\",\"September\",\"Oktober\",\"November\",\"Dezember\");\n"
."var now = new Date();\n"
."thisYear = now.getYear();\n"
."if(thisYear < 1900) {thisYear += 1900}; // corrections if Y2K display problem\n"
."document.write (now.getDate()+\".\" + monthNames[now.getMonth()] + \" \" + thisYear);\n"
."// -->\n"
."</script></td><td width=\"4\" height=\"30\"><img src=\"themes/BlueBump_jogi24/images/toplight_right.gif\" width=\"4\" height=\"30\"></td></tr></table>\n"
."<td align=\"left\" height=\"30\" width=\"70%\"><IMG src=\"themes/BlueBump_jogi24/images/pixel.gif\" width=\"24\" height=\"30\" border=\"0\" hspace=\"0\"><A href=\"/\"><IMG src=\"themes/BlueBump_jogi24/images/home.gif\" width=\"24\" height=\"30\" alt=\"Home\" border=\"0\" hspace=\"5\"></a><A href=\"modules.php?op=modload&name=My_eGallery&file=index\"><IMG src=\"themes/BlueBump_jogi24/images/themes.gif\" width=\"24\" height=\"30\" alt=\"Party-Fotos\" border=\"0\" hspace=\"5\"></a><A href=\"modules.php?name=Downloads\"><IMG src=\"themes/BlueBump_jogi24/images/downloads.gif\" width=\"24\" height=\"30\" alt=\"Downloads\" border=\"0\" hspace=\"5\"><A href=\"modules.php?name=Your_Account\"><IMG src=\"themes/BlueBump_jogi24/images/account.gif\" width=\"24\" height=\"30\" alt=\"Dein Account\" border=\"0\" hspace=\"5\"></a><A href=\"modules.php?name=Submit_News\"><IMG src=\"themes/BlueBump_jogi24/images/submitnews.gif\" width=\"24\" height=\"30\" alt=\"News schreiben\" border=\"0\" hspace=\"5\"></a><A href=\"modules.php?name=Top\"><IMG src=\"themes/BlueBump_jogi24/images/topten.gif\" width=\"24\" height=\"30\" alt=\"Top 10\" border=\"0\" hspace=\"5\"></a></td>\n"
."<td align=\"right\" width=\"10%\"> </td>\n"
."</tr>\n"
."</table><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"\" align=\"center\" background=\"themes/BlueBump_jogi24/images/under_hl.gif\" height=\"15\"><tr>\n"
."<td><IMG src=\"themes/BlueBump_jogi24/images/under_hl.gif\" height=\"15\" alt=\"\" border=\"0\" hspace=\"0\"></td></tr></table>\n"
."<!-- FIN DEL TITULO -->\n"
."<table width=\"95%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" bgcolor=\"#DEDEE6\" align=\"center\"><tr valign=\"top\">\n"
."<td bgcolor=\"#DEDEE6\" width=\"150\" valign=\"top\">\n";
blocks(left);
echo "</td><td><img src=\"themes/BlueBump_jogi24/images/pixel.gif\" width=\"15\" height=\"1\" border=\"0\" alt=\"\"></td><td width=\"100%\">\n";
include ("themes/BlueBump_jogi24/cblock.php");
}
nun muss dort ja body rein und der div!!
Wie immer ohne Gewähr ;)
echo "<body bgcolor=\"#DEDEE6\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" [b]onload=\"init();\">[/b]\n"
[b] ."<div id=\"divBottom\"><img src=\"images/icons/icon_rolleyes.gif\" border=0></div>"[/b]
."<p align=\"center\"><img src=\"themes/BlueBump_jogi24/images/test.jpg\" width=\"999\" height=\"100\">\n"
."<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" border=\"0\" align=\"center\" bgcolor=\"#7373A4\" background=\"themes/BlueBump_jogi24/images/headerline.gif\" height=\"30\"><tr valign=\"middle\"><td><IMG src=\"themes/BlueBump_jogi24/images/pixel.gif\" width=\"24\" height=\"30\" border=\"0\" hspace=\"0\"></td><td><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" background=\"themes/BlueBump_jogi24/images/toplight_bg.gif\"><tr>& lt;td width=\"4\" height=\"30\"><img src=\"themes/BlueBump_jogi24/images/toplight_left.gif\" width=\"4\" height=\"30\"></td>\n"
."<td nowrap class=\"artsubhead\" align=\"left\">\n";
ok hier macht er ohne probleme! Danke!
aber jetzt kommen wir mal zu my_header.php
die ist ja jetzt leer! Ist das normal? Sie enthält noch kein script drin.
der script ist ja in java script soll ich den dann in php umschreiben oder wie???
Zitat<script language="Javascript">
<!--
var w = 170;
var h = 70;
var n = (document.layers) ? 1:0;
var ie = (document.all) ? 1:0;
function makeObj(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.css=(n) ? eval(nest+'document.'+obj):eval(obj+'.style')
this.evnt=(n)? eval(nest+'document.'+obj):eval(obj);
this.moveIt=b_moveIt;}
function b_moveIt(x,y){
this.x=x; this.y=y
this.css.left=this.x
this.css.top=this.y}
var pageWidth,pageHeight
function init(){
oTest=new makeObj('divBottom')
pageWidth=(ie)?document.body.offsetWidth-4:innerWidth;
pageHeight=(ie)?document.body.offsetHeight-2:innerHeight;
checkIt()
if(ie) window.onscroll=checkIt;}
function f(){alert(f)}
function checkIt(){
if(ie) oTest.moveIt(document.body.scrollLeft+pageWidth-w,document.body.scrollTop+pageHeight-h)
else if(n){oTest.moveIt(window.pageXOffset+pageWidth-w, window.pageYOffset+pageHeight-h)
setTimeout('checkIt()',20)}}
//-->
</script>
<style>
<!--
#divBottom{color:blue;}
//-->
</style>
Ne Alex,
lass den Javascript und den Style so wie es ist.
Am Ende der Datei, nach dem ?> fügst Du den Quelltext ein.
PHP interpretiert dann diesen Code nur als HTML und das ganze wird in den HTML-Header der Seite eingefügt.
Ja stimmt der setzt den in den Header!
Die grafik wird angezeigt aber oben links in der ecke! Und bewegt sich nicht zu dem scrollen :exclam:
hier ist meine page: www.party-future.de
[Editiert am 21/10/2002 von A-L-E-X]
Hmmmm,
da ist ein Scriptfehler bei: body.scrollTop+p ageHeight-h)
Das Leerzeichen zwischen p ageHeight muss raus.
Bist Du sicher, dass das Script überhaupt funzt? Mit Javascript kann ich Dir leider nicht viel weiterhelfen... :cry
Also ja das script kannst du dir mal hier anschauen!
link--> http://www.jex-treme.de/dhtml/grafik/wz/wz.html
Sieht gut aus, im ie.
In Mozilla funzt es nicht ;)
Vergleiche mal den Quelltext der Beispielseite, das < d i v > Tag ist nicht komplett.
Dort steht id="divBottom" st yle="position:Absolute;width:40;height:20"
Vielleicht liegt's da dran. Aber wie gesagt, Jav asc ript ....... :(
ne ich habe den komplett und der funzt leider auch nicht :exclam:
:cry
Dann mal ein Aufruf an alle anderen User:
Kennt sich jemand besser mit dem Thema aus und kann hier weiterhelfen :quest
So wer sagts denn.. hab den script nun doch eingefügt!!!
mit etwas änderungen geht das ;)
Also wer wissen will wie soll mal hier reinposten!
logisch !!!
poste los :D