javascript will nicht :(

Alles zu Styles, Templates, Icons und Smilies für phpBB 3.0.x, sowie allgemeine Designfragen zur Integration von phpBB in bestehende Websites.
phpBB Styles Demo
Forumsregeln
Bei Style spezifischen Fragen ist der Stylename und die Downloadquelle des Styles erforderlich, besser noch die URL vom betroffenen Forum.
Antworten
vreezy117
Mitglied
Beiträge: 18
Registriert: 18.08.2010 10:17

javascript will nicht :(

Beitrag von vreezy117 »

Hallo ich hab da ein Problem. Ich versteh es nicht.

Ich hab einen javascript. der soll an der maus einfach einen div anzeigen. wenn ich folgenden code einfach in ein html datei packe macht der alles wunderbar richtig!
wenn ich es aber in phpbb3 einbinde führt er einfach:
document.getElementById('infobox').style.left = (PositionX+offsetx);
document.getElementById('infobox').style.top = (PositionY+offsety);
nicht aus.
die visibility und den txt übergibt er einwandfrei.
Ich hab jetzt sogar alle andere Javascripte rausgeschmissen weil ich dachte die stören. geht leider immer noch nicht. Wo ran könnte es liegen?
ANMERKUNG: Ich will nicht das jemand fremd code supportet. nur ein hinweis was es verhindert. Scheint irgendwie an phpbb oder irgendeiner internen einstellung zu liegen.

p.s.:
ohne Phpbb Funktioniert der code im IE(untouched) und Firefox(noscript (freigeschaltet), adblockplus, firebug) einwandfrei. Mit phpbb umgebung nicht.
Firebug meldet auch nichts. Ich kann eben nur wunderbar beobachten wie sich left und top umwandeln, ohne phpbb, und mit phpbb sich nur visibility und der text ändert.

Code: Alles auswählen

<html>
<head>
<script language="JavaScript" type="text/javascript">
<!--
var hfoffsetx=20
var hfoffsety=0

function InfoBoxAusblenden() {
      document.getElementById('infobox').style.visibility = "hidden";
}

function InfoBoxAnzeigen(e,txt,offsetX,offsetY)
{
        if (offsetX) {offsetx=offsetX;} else {offsetx=20;}
        if (offsetY) {offsety=offsetY;} else {offsety=0;}
        var PositionX = 0;
        var PositionY = 0;
        if (!e) var e = window.event;
        if (e.pageX || e.pageY)
        {
                PositionX = e.pageX;
                PositionY = e.pageY;
        }
        else if (e.clientX || e.clientY)
        {
                PositionX = e.clientX + document.body.scrollLeft;
                PositionY = e.clientY + document.body.scrollTop;
        }
        document.getElementById("text").innerHTML=txt;
        document.getElementById('infobox').style.left = (PositionX+offsetx);
        document.getElementById('infobox').style.top = (PositionY+offsety);
        document.getElementById('infobox').style.visibility = "visible";
}
// -->

</script>
<style type="text/css">
<!--


a.blau:link{
font-family:Arial,Helvetica,sans-serif;
font-size:12px;
font-weight:normal;
text-decoration:none;
color: #0000FF;
}
a.blau:visited {color:#0000FF;}
a.blau:hover{color:#FF007F;}

.infoText {
background-color:#F9FCFF;
border:8px solid #0090E0;
font-family:Arial,Helvetica,sans-serif;
font-size:12px;
color:#5F5F5F;
padding:15px;
}
-->
</style>


</head>
<body>
<!-- Anfang DIV-Layer -->
<div id="infobox" style="position:absolute; left:180px; top:25px ;z-index:100; visibility:hidden;">
<!-- Formatierung: Tabellenrand Hintergrundfarbe Schrift -->
<p class="infoText"><span id="text"></span></P>
</div>

<!-- Ende DIV-Layer -->


<a id="infobox" onmouseover="InfoBoxAnzeigen(event,'TEST',20,-40);" onmouseout="InfoBoxAusblenden();" href="javascript:void(0)"><img src="bildurl" width="120" height="90" border="0" alt=""></a><br>
</body>
</html>
Benutzeravatar
redbull254
Ehemaliges Teammitglied
Beiträge: 10379
Registriert: 05.01.2006 13:01
Kontaktdaten:

Re: javascript will nicht :(

Beitrag von redbull254 »

Hallo erstmal,

Du setzt es aber in die phpBB-Dateien ohne das hier ein?

Code: Alles auswählen

<html>
<head>
Beste Grüße
Walter
vreezy117
Mitglied
Beiträge: 18
Registriert: 18.08.2010 10:17

Re: javascript will nicht :(

Beitrag von vreezy117 »

ja in phpbb setz ich es natürlich ohne html und head tag ein . das ist der code 1:1 aus der test.html die ich angelegt habe um es zu testen.

hier der oberste teil meine overall_header.html (based on prosilver)
Die verlinkungen zu jeglichen *.js dateien und der direkte js für die popups hatte ich zum testen schon mal gelöscht.

Code: Alles auswählen

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}" xml:lang="{S_USER_LANG}">
<head>

<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-language" content="{S_USER_LANG}" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="copyright" content="2000, 2002, 2005, 2007 phpBB Group" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<!-- <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> -->
{META}
<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>

<!-- IF S_ENABLE_FEEDS -->
	<!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{U_FEED}?mode=topics" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" /><!-- ENDIF -->
	<!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&t={S_TOPIC_ID}" /><!-- ENDIF -->
<!-- ENDIF -->

<!--
	phpBB style name: Holyfreaks
	Based on style:   prosilver (this is the default phpBB3 style)
	Original author:  Tom Beddard ( http://www.subBlue.com/ )
	Modified by:	  Lars ' vreezy ' Eschweiler

	NOTE: This page was generated by phpBB, the free open-source bulletin board package.
	      The phpBB Group is not responsible for the content of this page and forum. For more information
	      about phpBB please visit http://www.phpbb.com
-->

<script language="JavaScript" type="text/javascript">
<!--
var offsetx=20
var offsety=0

function InfoBoxAusblenden() {
      document.getElementById('hhinfobox').style.visibility = "hidden";
}

function InfoBoxAnzeigen(e,txt,offsetX,offsetY)
{
        if (offsetX) {offsetx=offsetX;} else {offsetx=20;}
        if (offsetY) {offsety=offsetY;} else {offsety=0;}
        var PositionX = 0;
        var PositionY = 0;
        if (!e) var e = window.event;
        if (e.pageX || e.pageY)
        {
                PositionX = e.pageX;
                PositionY = e.pageY;
        }
        else if (e.clientX || e.clientY)
        {
                PositionX = e.clientX + document.body.scrollLeft;
                PositionY = e.clientY + document.body.scrollTop;
        }
        document.getElementById("hhtext").innerHTML=txt;
        document.getElementById('hhinfobox').style.left = 500;
        document.getElementById('hhinfobox').style.top = (PositionY+offsety);
        document.getElementById('hhinfobox').style.visibility = "visible";
}
// -->

</script>

<script type="text/javascript">
// <![CDATA[
	var jump_page = '{LA_JUMP_PAGE}:';
	var on_page = '{ON_PAGE}';
	var per_page = '{PER_PAGE}';
	var base_url = '{A_BASE_URL}';
	var style_cookie = 'phpBBstyle';
	var style_cookie_settings = '{A_COOKIE_SETTINGS}';
	var onload_functions = new Array();
	var onunload_functions = new Array();

	<!-- IF S_USER_PM_POPUP -->
		if ({S_NEW_PM})
		{
			var url = '{UA_POPUP_PM}';
			window.open(url.replace(/&/g, '&'), '_phpbbprivmsg', 'height=225,resizable=yes,scrollbars=yes, width=400');
		}
	<!-- ENDIF -->

	/**
	* Find a member
	*/
	function find_username(url)
	{
		popup(url, 760, 570, '_usersearch');
		return false;
	}

	/**
	* New function for handling multiple calls to window.onload and window.unload by pentapenguin
	*/
	window.onload = function()
	{
		for (var i = 0; i < onload_functions.length; i++)
		{
			eval(onload_functions[i]);
		}
	}

	window.onunload = function()
	{
		for (var i = 0; i < onunload_functions.length; i++)
		{
			eval(onunload_functions[i]);
		}
	}

// ]]>
</script>



<script type="text/javascript" src="{T_TEMPLATE_PATH}/styleswitcher.js"></script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/forum_fn.js"></script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/hfscript.js"></script>

<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" media="print" title="printonly" />
<link href="{T_STYLESHEET_LINK}" rel="stylesheet" type="text/css" media="screen, projection" />

<link href="{T_THEME_PATH}/normal.css" rel="stylesheet" type="text/css" title="A" />
<link href="{T_THEME_PATH}/medium.css" rel="alternate stylesheet" type="text/css" title="A+" />
<link href="{T_THEME_PATH}/large.css" rel="alternate stylesheet" type="text/css" title="A++" />

<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
	<link href="{T_THEME_PATH}/bidi.css" rel="stylesheet" type="text/css" media="screen, projection" />
<!-- ENDIF -->



<style type="text/css">
<!--


a.blau:link{
font-family:Arial,Helvetica,sans-serif;
font-size:12px;
font-weight:normal;
text-decoration:none;
color: #0000FF;
}
a.blau:visited {color:#0000FF;}
a.blau:hover{color:#FF007F;}

.hhinfoText {
background-color:#F9FCFF;
border:8px solid #0090E0;
font-family:Arial,Helvetica,sans-serif;
font-size:12px;
color:#5F5F5F;
padding:15px;
}
-->
</style>

</head>

<body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}">
<!-- <body id="phpbb" class="section-{SCRIPT_NAME} {S_CONTENT_DIRECTION}" onload="resize_images()"> -->


<!-- Anfang DIV-Layer -->
<div id="hhinfobox" style="position:absolute; left:180px; top:25px; z-index:100; visibility:hidden;">
<!-- Formatierung: Tabellenrand Hintergrundfarbe Schrift -->
<p class="hhinfoText"><span id="hhtext"></span></P>
</div>

<!-- Ende DIV-Layer -->

..... content divs bla....



vreezy117
Mitglied
Beiträge: 18
Registriert: 18.08.2010 10:17

Re: javascript will nicht :(

Beitrag von vreezy117 »

Ok habs geschaft.. wo ran es gelegen hat kann ich nicht 100% sagen keine lust mehr zu testen.
Angeblich liegt es an dem Doctype setzen.
Antworten

Zurück zu „[3.0.x] Styles, Templates und Grafiken“