PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of sandosh   iH2H Menu   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Intro with example
Class: iH2H Menu
Generate dynamic DHTML 2 level pull down menus
Author: By
Last change: Fixed a bug in IE
Date: 19 years ago
Size: 2,745 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>PHP DHTML Dynamic Menu</title>
<style type="text/css">
pre{
border: 1px solid #333333;
background-color:#F2F2F2;
}
</style>
<?
   
require_once("menu.php");
   
$menu = new iH2HMenu;
   
$menu->files("style.css","js.js");
?>
</head>
<body>
<a href="http://os.ih2h.net/menu/"><img src="http://os.ih2h.net/menu/logo.gif" width="246" height="49" border="0"></a>
<?

   
//Set Main link
   
$menu->setMainLink('Home','http://os.ih2h.net/menu/');
   
   
//Set Main link with sublink
   
$menu->setMainLink('other sites');
   
$menu->setSubLink('other sites','Web Designing','http://www.ih2h.net');
   
$menu->setSubLink('other sites','H2Hmail','http://www.h2hmail.com');
   
   
//Set Main link
   
$menu->setMainLink('php classes','http://www.phpclasses.org/');
   
   
//Set Main link with sublink
   
$menu->setMainLink('Google','search.php');
   
$menu->setSubLink('Google','Google Search Engine','http://www.google.com');
   
$menu->setSubLink('Google','Gmail','http://www.gmail.com');
   
   
$menu->makeDivs();
?><div style="width:80%; padding:0 0 0 15px;">
<div style="height:30px; background-color:#D9E3EB; width:100%; border: solid 1px #A2B9CE; ">
<?
    $menu
->makeLinks();
?>
</div>
<br>
Hi,
<br>
<br>
If you do not have the class file <a href="http://os.ih2h.net/menu/ih2hmenu.zip"><strong>click here to download</strong></a><br>
<br>
This PHP class can be used to generate dynamic DHTML horizontal menus. The implementation is very simiple and can be modified with ease.<br>
It uses CSS for easy deployment.<br>
<br>
Example<br>
<pre>
    //Include the class file
    require_once(&quot;menu.php&quot;);

    //Instantiate the class<br> $menu = new iH2HMenu;

    //Files which define the class and javascript<br> $menu-&gt;files(&quot;style.css&quot;,&quot;js.js&quot;);

    //Set Main link<br> $menu-&gt;setMainLink('Home','http://os.ih2h.net/menu/');<br> <br> //Set Main link with sublink<br> $menu-&gt;setMainLink('other sites');<br> $menu-&gt;setSubLink('other sites','iH2H','http://www.ih2h.net');<br> $menu-&gt;setSubLink('other sites','H2Hmail','http://www.h2hmail.com');<br> <br> //Set Main link<br> $menu-&gt;setMainLink('php classes','http://www.phpclasses.org/');


    //Generate the layers
    $menu-&gt;makeDivs();

    //Generate the menu
    $menu-&gt;makelinks();

</pre>
<p><br>
  Please do not hesitate to contact me for comments, suggestions or any doubts<br>
  <strong><br>
  Sandosh Kumar VR</strong><br>
  sandosh@ih2h.net<br>
  <a href="http://www.ih2h.net/">http://www.ih2h.net/</a></p>
</div>
</body>
</html>