Hello to you all,
honestly I do not have any experience with javascript, that is why I hope at you all. I just copied the script I for dynamic context menu and added to my page, BUT it does not work . Funny is that if I test it via phase5 it work ......so I am very suprised...
The error code I get is: "bobexaple is null (zero) or no object" ???????
[code lang=sprache]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
<META NAME="DESCRIPTION" CONTENT="">
<META NAME="KEYWORDS" CONTENT="">
<meta name="robots" content="index,follow">
<link rel="stylesheet" href="../include/style.css" />
<script type="text/javascript" src="../include/script.js"></script>
<script type="text/javascript">zeiger="ul1";</script>
<!--[if IE 6]>
<link rel="stylesheet" href="../include/ie6.css" />
<![endif]-->
<!--[if IE]>
<link rel="stylesheet" href="../include/ie.css" />
<![endif]-->
<!--[if lt IE 6]>
<link rel="stylesheet" href="../include/ie5.css" />
<![endif]-->
<script type="text/javascript" src="switchcontent.js" >
</script>
<style type="text/css">
/*Style sheet used for demo. Remove if desired*/
.handcursor{
cursor:hand;
}
.switchgroup1{
padding-bottom:50px;
}
</style>
</head>
[/code lang=sprache].
[html]
<body onload="start()" body oncontextmenu="return false" onselectstart="return false" ondragstart="return false">
<div id="seite">
<div id="logo"><a href="index.htm"><img src="../img/logo.jpg" alt="" /></a></div>
<div id="navi_o">
<ul>
<li><a href="XXX.htm"><b>XXX</b> | </a></li>
<li><a href="XX.htm"><b>XX</b> | </a></li>
<li><span id="active"><b>XX</b> | </span></li>
<li><a href="XX.php"><b>XX</b></a></li>
</ul>
</div>
<div id="menu">
<ul>
<li><a href="javascript:void(0);" onclick="lese('ul1')"><b>X</b></a></li>
<ul id="ul1">
<li><a href="X.htm">X</a></li>
<li><span id="active">X</span></li>
</ul>
<li><a href="XX.php?nav=2"><b>XX</b></a></li>
</ul>
</div>
<div id="content">
<body text="#000000" bgcolor="#FFFFFF" link="#0000CC" alink="#0000CC" vlink="#0000CC">
<div><h5><a style="text-decoration:none" href="javascript:bobexample.sweepToggle('contract')">Contract</a> | <a style="text-decoration:none"
href="javascript:bobexample.sweepToggle('expand')">Expand</a></div></h5>
<h3 id="bobcontent1-title" class="handcursor">blablala </h3>
<div id="bobcontent1" class="switchgroup1">
</div>
<h3 id="bobcontent2-title" class="handcursor"> blablala </h3>
<div id="bobcontent2" class="switchgroup1">
</div>
<h3 id="bobcontent3-title" class="handcursor"> blablala </h3>
<div id="bobcontent3" class="switchgroup1">
</div>
<script type="text/javascript">
// MAIN FUNCTION: new switchcontent("class name", "[optional_element_type_to_scan_for]") REQUIRED
//1) Instance.setStatus(openHTML, closedHTML)- Sets optional HTML to prefix the headers to indicate open/closed states
//2) Instance.setColor(openheaderColor, closedheaderColor)- Sets optional color of header when it's open/closed
//3) Instance.setPersist(true/false)- Enables or disabled session only persistence (recall contents' expand/contract states)
//4) Instance.collapsePrevious(true/false)- Sets whether previous content should be contracted when current one is expanded
//5) Instance.defaultExpanded(indices)- Sets contents that should be expanded by default (ie: 0, 1). Persistence feature overrides this setting!
//6) Instance.init() REQUIRED
var bobexample=new switchcontent("switchgroup1", "div") //Limit scanning of switch contents to just "div" elements
bobexample.setColor('darkred', 'black')
bobexample.setPersist(true)
bobexample.collapsePrevious(true) //Only one content open at any given time
bobexample.init()
</script>
<script type="text/javascript">
var joeexample=new switchcontent("switchgroup2", "p") //Limit scanning of switch contents to just "p" elements
joeexample.setStatus('[open] ', '[closed] ')
joeexample.setColor('green', 'red')
joeexample.collapsePrevious(false) //Allow more than 1 content to be open simultanously
joeexample.setPersist(false)
joeexample.defaultExpanded(0,1)
joeexample.init()
</script>
<div id="footer">
<div id="foot_txt">
<a href="xxx.htm">xxx</a> | <a href="xxx.php">xxxt</a> | <a href="A.htm">A</a>
</div>
<div id="xxx"><a href="http://www.xxx.de">xxx.de</a></div>
</div>
</div>
</body>
</html>
[html]