HTML
  Home arrow HTML arrow Page 5 - How to Create a Dynamic HTML Navigation Pa...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

How to Create a Dynamic HTML Navigation Page
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 23
    2004-09-07

    Table of Contents:
  • How to Create a Dynamic HTML Navigation Page
  • Web Animation Doesn't Always Mean Flash
  • Subroutines
  • The Remaining Subroutines
  • Wrap'n it Up
  • Images to Use

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    How to Create a Dynamic HTML Navigation Page - Wrap'n it Up


    (Page 5 of 6 )

    Once you've ended the subroutine and then the script tag, you can safely say that your work here is done; save the file with an .htm extension and preview it. Your complete code file should now look like this:

    <html>
    <head>
    <title>Alternative Navigation System</title>
    <script language="vbscript">
    dim leftButtonDown
    dim upbuttonDown
    dim rightButtonDown
    dim downButtonDown
    dim animator
     sub flyLeft
      if leftButtonDown=1 then
       call moveImage(saucer,-1,0)
       if window.saucer.style.left="75px" then
        window.location="info.htm"
       end if
      else
       exit sub
      end if
     End sub
     sub flyUp
      if upButtonDown=1 then
       call moveImage(saucer,0,-1)
       if window.saucer.style.top="75px" then
        window.location="shop.htm"
       end if
      else
       exit sub
      end if
     End sub
     sub flyRight
      if rightButtonDown=1 then
       call moveImage(saucer,1,0)
       if window.saucer.style.left="450px" then
        window.location="help.htm"
       end if
      else
       exit sub
      end if
     End sub
     sub flyDown
      if downButtonDown=1 then
       call moveImage(saucer,0,1)
      else
       exit sub
      end if
     End sub
     sub buttonLeft_onMouseDown
      animator=window.setInterval("flyLeft", 10)
      leftButtonDown=1
     End sub
     sub buttonLeft_onMouseUp
      window.clearInterval(animator)
      leftButtonDown=0
     end sub
     sub buttonUp_onMouseDown
      animator=window.setInterval("flyUp", 10)
      upButtonDown=1
     End sub
     sub buttonUp_onMouseUp
      window.clearInterval(animator)
      upButtonDown=0
     end sub
     sub buttonRight_onMouseDown
      animator=window.setInterval("flyRight", 10)
      rightButtonDown=1
     End sub
     sub buttonRight_onMouseUp
      window.clearInterval(animator)
      rightButtonDown=0
     end sub
     sub buttonDown_onMouseDown
      animator=window.setInterval("flyDown", 10)
      downButtonDown=1
     End sub
     sub buttonDown_onMouseUp
      window.clearInterval(animator)
      downButtonDown=0
     end sub
     sub moveImage(ElementID,LeftMovementAmount,TopMovementAmount)
      pPositionLeft=InStr(ElementID.style.left,"px")
      pPositionTop=InStr(ElementID.style.top,"px")
      ElementID.style.left=CInt(Left(ElementID.style.left,pPositionLeft-1))+LeftMovementAmount
      ElementID.style.Top=CInt(Left(ElementID.style.top,pPositionTop-1))+TopMovementAmount
     End sub
    </script>
    </head>
    <body>
    <div id=info Style="position:absolute;left:50px;top:250px;">
    <img src="info.gif" border="0">
    </div>
    <div id=shop Style="position:absolute;left:350px;top:50px;">
    <img src="shop.gif" border="0">
    </div>
    <div id=help Style="position:absolute;left:650px;top:250px;">
    <img src="help.gif" border="0">
    </div>
    <div id=saucer Style="position:absolute;left:275px;top:250px;">
    <img src="saucer.gif" border="0">
    </div>
    <div id=buttonUp Style="position:absolute;left:350px;top:403px;">
    <img src="up.gif" border="0">
    </div>
    <div id=buttonLeft Style="position:absolute;left:236px;top:480px;">
    <img src="left.gif" border="0">
    </div>
    <div id=buttonRight Style="position:absolute;left:423px;top:480px;">
    <img src="right.gif" border="0">
    </div>
    <div id=buttonDown Style="position:absolute;left:350px;top:525px;">
    <img src="down.gif" border="0">
    </div>
    </body>
    </html>

    And you should have a fully functioning, interactive navigation page that loads a new page whenever a specified location of the window is passed over by the central image.

    More HTML Articles
    More By Dan Wellman


       · It would be great if you provided a working example so we could see how it works...
       · Maybe someone might find this a good article but it lacks detail and really doesn't...
       · Agreed. Thats the first thing I look for in a tutorial, so I can understand what...
       · Generally most browsers nowadays support VB script, however.. this is all written in...
       · I created a web page and copied all the graphics. When I open this in IE 6.0 with XP...
       · Please correct me if I'm mistaken, but only ONE browser supports VBscript - yes I...
       · I'm surprised that this script didn't work for anyone running IE6 on XP Pro, that is...
       · Youve got very useful site. It really helped me. Thanks.
       · Youve got a great site. I found it very useful.
     

    HTML ARTICLES

    - Sorting for Database Forms with HTML
    - Edit and Other Database Form Functions with ...
    - More Database Form Functions with HTML
    - Database Form Functions with HTML
    - Using the HTML Table Element as a Recordset
    - Building Single Row Database Forms with HTML
    - Introduction to Database Forms with HTML
    - Another Look at Animation of Geographical Ma...
    - Animation of Geographical Map Regions
    - Changing and Moving Pictures with CSS
    - Clickable Geographical Map Regions
    - Gradient Creation with the HR Element
    - Text on HTML Images: Do it Yourself
    - Custom Buttons in HTML
    - Quick Web Page Menu







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway