![]() | | ||||||||
| | #1 |
| Advanced Warrior Join Date: Nov 2008
Posts: 609
Thanks: 31
Thanked 1 Time in 1 Post
|
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... |
| | |
| | #2 |
| Graphic Designer War Room Member Join Date: Apr 2009 Location: Newcastle,Australia
Posts: 209
Thanks: 3
Thanked 12 Times in 10 Posts
|
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> |
| "Design is intelligence made visible" | |
| | |
| | #3 |
| Active Warrior War Room Member Join Date: Sep 2009
Posts: 93
Thanks: 28
Thanked 4 Times in 4 Posts
|
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 |
| | |
| | |
| | #4 |
| Graphic Designer War Room Member Join Date: Apr 2009 Location: Newcastle,Australia
Posts: 209
Thanks: 3
Thanked 12 Times in 10 Posts
|
Handy little site that CB
|
| "Design is intelligence made visible" | |
| | |
| | #5 | |
| Advanced Warrior Join Date: Nov 2008
Posts: 609
Thanks: 31
Thanked 1 Time in 1 Post
| Quote:
Thanks for that.. I have followed the tutorial but that only covers text hovers, not image hovers... | |
| | |
![]() |
|
| Tags |
| explain, step |
| Thread Tools | |
| |
![]() |