Viewing topic:Onclick image change
Page:
1
25-09-2007 - 16:21
oke this is going to be hard to explain...
i would like to have a drop down box with color names in it
(black, blue, green, red, pink, purple)
and if you click one of those colors that the Header changes to that color
i have already made the headers in the colors noted above.
but i just want the header to change not the entire page
so please help me (A)
CODE:
i would like to have a drop down box with color names in it
(black, blue, green, red, pink, purple)
and if you click one of those colors that the Header changes to that color
i have already made the headers in the colors noted above.
but i just want the header to change not the entire page
so please help me (A)
CODE:
| code | |
|
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 |
<HTML>
<HEAD>
<TITLE> My page </TITLE>
</HEAD>
<body style="filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#FFFFFF', startColorstr='#000000', gradientType='0');">
<p><body style="filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#FFFFFF',
startColorstr='#000000', gradientType='0');">
<CENTER>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 cellPadding=0 height=10 width=519 border=1 bgcolor=FFFFFF>
<TR>
<TD vAlign=top width=521 height=151>
<CENTER>
<IMG SRC="FilesImagespsplogo_black.jpg" border="0" usemap="#Photo">
</CENTER>
</TD>
</TR>
<TR>
<TD vAlign="top"width=514 bgColor=#f0f0f0 height=20>
<CENTER>
<a HREF="Index.htm"> Home </a>
</CENTER>
</TD>
</TR>
<TR>
<TD vAlign="top" width=514 bgColor=#f0f0f0 height=500>
<CENTER>
<BR>
<STRONG>
<U>Log3</U>
</STRONG>
<BR>
<BR>
TEMP PLACE FOR DROP DOWN BOX
<BR>
<HR width="50%">
<STRONG>
<U>Log2</U>
</STRONG>
<BR>
<BR>
Added tables and stuff.... next? visuals :P
<HR width="50%">
<STRONG>
<U>Log1</U>
</STRONG>
<BR>
<BR>
Base Site
<HR width="50%">
</CENTER>
</TD>
</TR>
<TR>
<TD vAlign=top width=514 bgColor=#f0f0f0 height=20>
<CENTER>
<A HREF="Apple.html"><img border="0"height="25" width="25" src="FilesImagesapple.jpg"></A>
Design provided by Dave
</TD>
</TR>
</table>
</CENTER>
<map name="Photo">
<area shape="poly" coords="82,89" href="#"><area shape="poly" coords="37,90,37,62,52,62,54,53,65,53,69,62,82,62,82,89" href="Photo.htm" target="_self">
<area shape="poly" coords="158,71" href="#"><area shape="poly" coords="175,86,175,52,170,53,154,53,151,51,149,80,141,85,141,91,149,91,153,86,154,76,154,66,154,60,163,61,171,61,171,72,171,80,165,83,162,89,169,91" href="Music.htm" target="_self">
<area shape="poly" coords="291,88" href="#"><area shape="poly" coords="291,89" href="#"><area shape="poly" coords="292,89,291,54,278,54,278,58,254,59,253,54,240,54,240,89,254,88,254,83,278,82,278,89" href="Video.htm" target="_self">
<area shape="poly" coords="356,78" href="#"><area shape="poly" coords="379,78,355,78,346,93,337,93,333,89,337,59,344,51,351,50,359,53,362,56,375,56,381,50,387,50,394,53,397,60,401,89,399,94,391,94,386,91" href="Game.htm">
<area shape="circle" coords="455,72,23" href="Web.htm" target="_self">
</map></BODY>
</HTML>
|
25-09-2007 - 18:56
25-09-2007 - 19:16
| code | |
|
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 |
<html>
<head>
<title>Javascript test</title>
<script language="javascript">
function setColor(colorX) {
document.getElementById('header').style.color=colorX;
}
</script>
</head>
<body>
<h1 id="header">Realtime color changing</h1><br>
<br>
<br>
<select name="color">
<option value="black" onClick="setColor('#000000')">Black</option>
<option value="green" onClick="setColor('#00a818')">Green</option>
</select>
</body>
</html>
|
26-09-2007 - 05:13
I think the most efficient cross browser method would be to have multiple style sheets, and just toggle between them. (For a full site)
26-09-2007 - 09:00
What about adding a div around the image and changing the code with document.GetEl.......InnerHTML = "difHTML"; ?
26-09-2007 - 21:41
I heard you found a nice solution and that it works perfectly fine now. Can you post it in the topic? (url via [url] tags? If neccesary i will give you a dave.combined-midns.net subdomain...)
Javascript might not be so nice to read, doesnt always work with al browsers, aint that fast, but damn it can be fun.
Javascript might not be so nice to read, doesnt always work with al browsers, aint that fast, but damn it can be fun.
Page:
1
Reply to topic
Reply to topic

