Results 1 to 6 of 6

Thread: Go to top content

  1. #1
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Go to top content

    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:
    PHP Code:
      <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>

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Can you also post the "View Source" part of the menu so we can see how this PHP outputs?
    Thanks.
    Jeremy | jfein.net

  3. #3
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    PHP Code:
    <?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>&nbsp;</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);
    ?>

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    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.
    Jeremy | jfein.net

  5. #5
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  6. #6
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry, but I had to delete this link..
    I still did nog find a solution.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •