Results 1 to 5 of 5

Thread: Web page programming

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    I am frustrated because I cannot find a good web page
    tutorial source or good source code. I want to make
    a colorful navigation menu that has popup submenus when
    the mouse cursor is over the menu item. Like on this site:

    http://www.component1.com/

    Please let me know how to do this.

  2. #2
    Fanatic Member
    Join Date
    Jun 2000
    Posts
    537
    just view the source.
    it's all there.
    pnj

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    Yeah, I know. I can see the source code, but I was really
    looking for a tutorial or something like that.
    The code is too damn confusing to be useful.

  4. #4
    Junior Member
    Join Date
    May 2000
    Location
    Milwaukee, Wi
    Posts
    28

    Talking this is long reply!

    the rollovers are simple javascript. here is some code that i've found very stable and compatible over many browsers:

    mouseover code:
    ************************************************************
    function MM_swapImage() { //v2.0
    var i,j=0,objStr,obj,swapArray=new
    Array,oldArray=document.MM_swapImgData;
    for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
    objStr = MM_swapImage.arguments[(navigator.appName ==
    'Netscape')?i:i+1];
    if ((objStr.indexOf('document.layers[')==0 && document.layers==null)
    ||
    (objStr.indexOf('document.all[') ==0 && document.all ==null))
    objStr =
    'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
    obj = eval(objStr);
    if (obj != null) {
    swapArray[j++] = obj;
    swapArray[j++] = (oldArray==null ||
    oldArray[j-1]!=obj)?obj.srcldArray[j];
    obj.src = MM_swapImage.arguments[i+2];
    } }
    document.MM_swapImgData = swapArray; //used for restore
    }
    ************************************************************

    mouseout code:
    ************************************************************
    function MM_swapImgRestore() { //v2.0
    if (document.MM_swapImgData != null)
    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
    document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
    }
    ************************************************************

    here's how to use it. just copy the above functions into your <script> tag. then in your <a href> tag, include this:

    onMouseOver = "MM_swapImage('document.img1','document.img1','img2.gif')" onMouseOut = "MM_swapImgRestore()"

    img1 is your initial graphic and img2 is the highlighted one.

    Now, as for the drop down menus. Look at http://www.webmonkey.com. they have great tutorials on a lot of dhtml topics. but pnj had it right. the best way is always to look at the source code. if you look at enough of it, you'll start recognizing the common stuff.

    hope this helps!

    shaba
    http://www.ahmonra.com

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    hey, webmonkey is cool!
    that's the menu i want.

    thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width