Professional Web Applications Themes

Rollover images - HTML & CSS

Hello I am a student that is learning web development using Dreamweaver in an online class where there is no instructor interaction. I have been assigned to yze this mouseover script that dreamweaver throws in. I am aware of how to create a mouseover without the use of these functions, but I am required to describe what these functions do. However I do not understand what they do. I desperately need an in-depth description on how and what these functions do and why they are needed. function MM_swapImgRestore() { //v3.0 var i,x,a=doent.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var ...

  1. #1

    Default Rollover images

    Hello
    I am a student that is learning web development using Dreamweaver in an online
    class where there is no instructor interaction. I have been assigned to
    yze this mouseover script that dreamweaver throws in. I am aware of how to
    create a mouseover without the use of these functions, but I am required to
    describe what these functions do. However I do not understand what they do. I
    desperately need an in-depth description on how and what these functions do and
    why they are needed.

    function MM_swapImgRestore() { //v3.0
    var i,x,a=doent.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++)
    x.src=x.oSrc;
    }

    function MM_preloadImages() { //v3.0
    var d=doent; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length;
    i++)
    if (a.indexOf("#")!=0){ d.MM_p=new Image; d.MM_p.src=a;}}
    }

    function MM_findObj(n, d) { //v4.01
    var p,i,x; if(!d) d=doent;
    if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames.doent; n=n.substring(0,p);}
    if(!(x=d)&&d.all) x=d.all; for (i=0;!x&&i<d.forms.length;i++) x=d.forms;
    for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    x=MM_findObj(n,d.layers.doent);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_swapImage() { //v3.0
    var i,j=0,x,a=MM_swapImage.arguments; doent.MM_sr=new Array;
    for(i=0;i<(a.length-2);i+=3)
    if ((x=MM_findObj(a))!=null){doent.MM_sr=x; if(!x.oSrc) x.oSrc=x.src;
    x.src=a;}
    }


    Gary Richter Guest

  2. #2

    Default Re: Rollover images

    The heart and soul of the functions is this
    > function MM_findObj(n, d) { //v4.01
    It's what verifies that each image is actually on the page, so that you
    don't get a javascript error. It is called by the actual swap image
    function (function MM_swapImage() { //v3.0) -
    > for(i=0;i<(a.length-2);i+=3)
    > if ((x=MM_findObj(a))!=null){doent.MM_sr=x; if(!x.oSrc)
    > x.oSrc=x.src;
    before actually performing the rewriting of the src attributes.

    Then this function -
    > function MM_swapImgRestore() { //v3.0
    > var i,x,a=doent.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++)
    > x.src=x.oSrc;
    > }
    just rolls the original image back into place onMouseOut.

    Is that what you wanted?

    --
    Murray --- ICQ 71997575
    Team Macromedia Volunteer for Dreamweaver
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================


    "Gary Richter" <webforumsusermacromedia.com> wrote in message
    news:drjrid$aec$1forums.macromedia.com...
    > Hello
    > I am a student that is learning web development using Dreamweaver in an
    > online
    > class where there is no instructor interaction. I have been assigned to
    > yze this mouseover script that dreamweaver throws in. I am aware of
    > how to
    > create a mouseover without the use of these functions, but I am required
    > to
    > describe what these functions do. However I do not understand what they
    > do. I
    > desperately need an in-depth description on how and what these functions
    > do and
    > why they are needed.
    >
    > function MM_swapImgRestore() { //v3.0
    > var i,x,a=doent.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++)
    > x.src=x.oSrc;
    > }
    >
    > function MM_preloadImages() { //v3.0
    > var d=doent; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    > var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
    > i<a.length;
    > i++)
    > if (a.indexOf("#")!=0){ d.MM_p=new Image; d.MM_p.src=a;}}
    > }
    >
    > function MM_findObj(n, d) { //v4.01
    > var p,i,x; if(!d) d=doent;
    > if((p=n.indexOf("?"))>0&&parent.frames.length) {
    > d=parent.frames.doent; n=n.substring(0,p);}
    > if(!(x=d)&&d.all) x=d.all; for (i=0;!x&&i<d.forms.length;i++) x=d.forms;
    > for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    > x=MM_findObj(n,d.layers.doent);
    > if(!x && d.getElementById) x=d.getElementById(n); return x;
    > }
    >
    > function MM_swapImage() { //v3.0
    > var i,j=0,x,a=MM_swapImage.arguments; doent.MM_sr=new Array;
    > for(i=0;i<(a.length-2);i+=3)
    > if ((x=MM_findObj(a))!=null){doent.MM_sr=x; if(!x.oSrc)
    > x.oSrc=x.src;
    > x.src=a;}
    > }
    >
    >

    Murray *TMM* Guest

  3. #3

    Default Rollover images

    I'm a new user to Dreamweaver and I cant figure out how to solve my problem.

    I need to have a small image 60 x 60 where I can rollover with the mouse and
    then a much larger image 550 x 413 appears below, although the small image
    should still remain the same. The ending result will be 10 small thumbnails and
    when you rollover each one they appear below a lot bigger. I dont mind using
    html if I have to.

    Anything is greatly appreciated, thanks.

    danny biy Guest

  4. #4

    Default Re: Rollover images

    In DW we call this a disjointed (or disjoint) rollover - here's a tut for
    you........

    [url]http://www.dwfaq.com/tutorials/basics/disjointed.asp[/url]



    --
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
    [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
    [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
    ==================


    "danny biy" <webforumsusermacromedia.com> wrote in message
    news:e6uf40$k1q$1forums.macromedia.com...
    > I'm a new user to Dreamweaver and I cant figure out how to solve my
    > problem.
    >
    > I need to have a small image 60 x 60 where I can rollover with the mouse
    > and
    > then a much larger image 550 x 413 appears below, although the small image
    > should still remain the same. The ending result will be 10 small
    > thumbnails and
    > when you rollover each one they appear below a lot bigger. I dont mind
    > using
    > html if I have to.
    >
    > Anything is greatly appreciated, thanks.
    >

    Murray *ACE* Guest

  5. #5

    Default rollover images

    I have a site that has simple rollover images. Can you not edit these in Contribute? Thanks so much
    grace2937 Guest

  6. #6

    Default Re: rollover images

    This can be achieved on DW side. You can edit the page having this rollover images in Contribute, not the functionality of it.
    Dominic Michael Guest

  7. #7

    Default Re: rollover images

    I'm adding to your question - can you add rollover images in Contribute? I know I can do it in Dreamweaver.
    Kerrian Neu Guest

  8. #8

    Default Re: rollover images

    No. You cannot add/edit a rollover image in Contribute.
    Shilpa_ Guest

  9. #9

    Default Re: rollover images

    I've done this successfully using the Insert HTML snippet. Requires code editing, though.

    Editing an existing one is actually deleting then replacing.
    junkadelic Guest

Similar Threads

  1. swap images + rollover question
    By katpiper in forum Macromedia Dynamic HTML
    Replies: 2
    Last Post: August 16th, 04:42 PM
  2. separate javascript file for rollover images inincludes?
    By Jonibean in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: December 28th, 03:30 AM
  3. Timed Rollover Images
    By edx_baxter in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: October 7th, 04:48 PM
  4. Flash buttons vs rollover images and javascript
    By greg people in forum Macromedia Flash
    Replies: 1
    Last Post: February 7th, 07:45 PM
  5. Rollover Images with Templates
    By nts6837 webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 1
    Last Post: July 12th, 01:34 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139