Ulitasch
10-20-2008, 09:56 PM
I am using the Accordion Content script (vertical CSS menu) from Dynamic Drive DHTML. My expandable menu's contain long texts and you have to scroll them. I always stay on the same page (index.php) so if the visitor scrolls in one text opened from one menu-item, opens another menu-item and goes back to the first one it still is on the same spot where he left the text.
I would like that all the menu-items go back to the top when opening them.. Someone understand what I mean and has a tip..?
Thanks a lot for helping me out.
This is my code for the menu:
<div class="arrowlistmenu">
<?php do { ?>
<h3 class="menuheader expandable"><?php echo $row_rsRechts['menuheader']; ?></h3>
<ul class="categoryitems">
<div id="height_scroll"><?php echo $row_rsRechts['content_txt']; ?></div>
<br />
</ul>
<?php } while ($row_rsRechts = mysql_fetch_assoc($rsRechts)); ?>
</div>
Can you also post the "View Source" part of the menu so we can see how this PHP outputs?
Thanks.
Ulitasch
10-22-2008, 07:35 PM
<?php require_once('Connections/connMullerfonds.php'); ?>
<?php
// Load the tNG classes
require_once('includes/tng/tNG.inc.php');
// Make unified connection variable
$conn_connMullerfonds = new KT_connection($connMullerfonds, $database_connMullerfonds);
//Start Restrict Access To Page
$restrict = new tNG_RestrictAccess($conn_connMullerfonds, "");
//Grand Levels: Any
$restrict->Execute();
//End Restrict Access To Page
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_connMullerfonds, $connMullerfonds);
$query_rsLinks = "SELECT * FROM content WHERE menuLinks = 'Y' ORDER BY volgorde ASC";
$rsLinks = mysql_query($query_rsLinks, $connMullerfonds) or die(mysql_error());
$row_rsLinks = mysql_fetch_assoc($rsLinks);
$totalRows_rsLinks = mysql_num_rows($rsLinks);
mysql_select_db($database_connMullerfonds, $connMullerfonds);
$query_rsRechts = "SELECT * FROM content WHERE menuLinks = 'N' ORDER BY volgorde ASC";
$rsRechts = mysql_query($query_rsRechts, $connMullerfonds) or die(mysql_error());
$row_rsRechts = mysql_fetch_assoc($rsRechts);
$totalRows_rsRechts = mysql_num_rows($rsRechts);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml2/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<script type="text/javascript" src="Scripts/jquery-1.2.2.pack.js"></script>
<script type="text/javascript" src="Scripts/ddaccordion.js">
/***********************************************
* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/
</script>
<script type="text/javascript">
ddaccordion.init({
headerclass: "expandable", //Shared CSS class name of headers group that are expandable
contentclass: "categoryitems", //Shared CSS class name of contents group
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
animatedefault: false, //Should contents open by default be animated into view?
persiststate: false, //persist state of opened contents within browser session?
toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "normal", //speed of animation: "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isclicked){ //custom code to run whenever a header is opened or closed
//do nothing
}
})
</script>
<link href="CSS/basic.css" rel="stylesheet" type="text/css" />
<link href="CSS/menu.css" rel="stylesheet" type="text/css" />
<LINK REL="shortcut icon" type="image/x-icon" href="img/favicon.ico" />
<!--[if lt IE 7]>
<script defer type="text/javascript" src="Scripts/pngfix.js"></script>
<![endif]-->
</head>
<body>
<p> </p>
<div id="horizon">
<div id="content">
<div id="logo">
<div><img src="img/logo.jpg" alt="Mullerfonds" width="117" height="110" /></div>
</div>
<div id="menuLinks">
<div class="arrowlistmenu">
<?php do { ?>
<h3 class="menuheader expandable"><?php echo $row_rsRechts['menuheader']; ?></h3>
<ul class="categoryitems">
<div id="height_scroll"><?php echo $row_rsRechts['content_txt']; ?></div>
<br />
</ul>
<?php } while ($row_rsRechts = mysql_fetch_assoc($rsRechts)); ?>
</div>
</div>
<div id="menuRechts">
<div class="arrowlistmenu2">
<?php do { ?>
<h3 class="menuheader expandable"><?php echo $row_rsLinks['menuheader']; ?></h3>
<ul class="categoryitems">
<div id="height_scroll"><?php echo $row_rsLinks['content_txt']; ?></div>
<br />
</ul>
<?php } while ($row_rsLinks = mysql_fetch_assoc($rsLinks)); ?>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
mysql_free_result($rsLinks);
mysql_free_result($rsRechts);
?>
I'm sure thats not the output of the code. I want the output of the code, not the whole code. Sorry for any misunderstandings Ulitasch.
Ulitasch
10-23-2008, 08:46 AM
Hey Nile, thanks again for answering and sorry ... but the output is TOO long.
The thing is very clear when you see the website.
So here is the website, then you can view the output:
http://www.mullerfonds.nl/subsidies/index2.php
If you scroll on one it STAYS there and does not go back to the top. I cannot write Javascript so.. probably there is something to do there?
Ulitasch
11-04-2008, 02:59 PM
sorry, but I had to delete this link..
I still did nog find a solution.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.