8 Replies Latest reply on Oct 18, 2010 4:40 PM by MurraySummers

    Rollover image without ActiveX

    XxDizzyxX

      Hello,

       

      How can I make a simple rollover image without having ActiveX to be enabled on IE.

       

      Is it possible with CSS??

        • 1. Re: Rollover image without ActiveX
          MurraySummers Level 8

          ActiveX is not necessary for any rollover effect, which is just a simple javascript image swap.

          • 2. Re: Rollover image without ActiveX
            MurraySummers Level 8

            And it's certainly possible to do in CSS - Google CSS Sprites....

            • 3. Re: Rollover image without ActiveX
              XxDizzyxX Level 1

              Alright,

               

              So when I use the dreamweaver *Add Image:Rollover image*

               

              as soon as i export it and open it with IE it says i need to enable ActiveX. Will that go once i upload my image onto the web?

              • 4. Re: Rollover image without ActiveX
                MurraySummers Level 8

                Which IE?

                 

                ActiveX has nothing whatsoever to do with javascript - so that's a very strange message.  And what do you mean by "export it"?  Do you mean save it and preview it in IE within DW?

                • 5. Re: Rollover image without ActiveX
                  XxDizzyxX Level 1

                  yes, when i preview it in IE. It asks me to enable ActiveX so that my rollover images will work.

                   

                  now how can I make a rollover image (button) thats also apart of my banner that I've sliced up,

                  without having to enable ActiveX.

                   

                  I'm not huge on CSS and java script. So is there a simple way of doing it? :D

                  • 6. Re: Rollover image without ActiveX
                    MurraySummers Level 8

                    Let me try this again.  Rollover images DO NOT REQUIRE Active X.  If you are getting that alert, then you are getting it for some other reason unrelated to the rollover image.  Show us the code on the page that is throwing this alert, please.  Perhaps its there.

                     

                    I'm not huge on CSS and java script. So is there a simple way of doing it?

                     

                    If you want to use DW then this will have to change.

                    • 7. Re: Rollover image without ActiveX
                      XxDizzyxX Level 1

                      so this is my code. just for my rollover image..nothing else is on the page.

                       

                       

                       

                       

                      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                      <html xmlns="http://www.w3.org/1999/xhtml">
                      <head>
                      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                      <title>Untitled Document</title>
                      <script type="text/javascript">
                      <!--
                      function MM_swapImgRestore() { //v3.0
                        var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
                      }
                      function MM_preloadImages() { //v3.0
                        var d=document; 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[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
                      }

                       

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

                       

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

                       

                      <body onload="MM_preloadImages('file:///H|/MySite/Images/homeroll.jpg')">
                      <a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','file:///H|/MySite/Images/homeroll.jpg',1)"><img src="file:///H|/MySite/Images/home.jpg" name="Image1" width="150" height="50" border="0" id="Image1" /></a>
                      </body>
                      </html>

                       

                       

                      • 8. Re: Rollover image without ActiveX
                        MurraySummers Level 8

                        Other than the fact that your image links are all broken and will not work on the web, there is absolutely nothing wrong or unusual about this code.  Nor is there anything that would require ActiveX.  What would cause DW to think those images are outside of the root of your local site?  You have defined a site, right?