Can Some Please Explain How To Do This Step By Step?

4 replies
  • WEB DESIGN
  • |
Alright guys

I very much need a little bit of help, because at the moment I a very stumped at the moment..

Please take a look at this website Untitled Document

I have been able to create a navigation bar under the header and now I am adding images to it.. These images, are home, about us, affiliates, contact us, etc.

What I would like to do is when you move the mouse over this images it changes color, then when you click on one image it changes color..

I know it has got something to do with hovers, etc.. But I dont know where to start.. Can someone explain in, dont go too techinical on me, do it very basic please...............

Oh btw I am using php and css for my website...
#explain #step
  • Profile picture of the author eCovers4uGfx
    Byron,

    You can do it with Hovers/Mouse Overs & Onloads

    Or a simple javscript code ie: like I have done for you below
    just chance the image location and your on mouse over image
    I have labelled "home2" in the body section


    <----------Paste Into Head------------>

    <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>


    <----------end head script------------>

    <----------Paste into body------------>

    <body onload="MM_preloadImages('http://www.supreme-host.com/web/images/home2.jpg')">
    <a href="http://www.supreme-host.com" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','http://www.supreme-host.com/web/images/home2.jpg',1)"><img src="http://www.supreme-host.com/web/images/home.jpg" name="Image1" width="121" height="35" border="0" id="Image1" /></a>
    </body>
    {{ DiscussionBoard.errors[1509384].message }}
    • Profile picture of the author cbright
      Byron, visit tizag.com

      You need to use the css hovers, not the javascript, even though it works, I don't know it's just preference.

      But bookmark that site! It's a great reference for code whenever you forget a tag or the coding syntax/structure of a coding language
      {{ DiscussionBoard.errors[1509428].message }}
      • Profile picture of the author eCovers4uGfx
        Handy little site that CB
        {{ DiscussionBoard.errors[1509431].message }}
      • Profile picture of the author Byron_Wells
        Originally Posted by cbright View Post

        Byron, visit tizag.com

        You need to use the css hovers, not the javascript, even though it works, I don't know it's just preference.

        But bookmark that site! It's a great reference for code whenever you forget a tag or the coding syntax/structure of a coding language
        Alright cbright

        Thanks for that.. I have followed the tutorial but that only covers text hovers, not image hovers...
        {{ DiscussionBoard.errors[1512362].message }}

Trending Topics