Just to let you know, I'm a rookie. I try to programm a certain function for the menu-navigation on my website. (http://thomasmedicus.at/)
I want visitors on my website to be able to sort my projects either by "date" or by "relevance". I created this image so you can understand me better: preview
in the first image the projects are sortet by relevance. therefor "date" is striked trough. when you now click on the stricked trough "date" the order of the projects (2, 1, 3) changes. what also happens is that "relevance" is strickt trough and "date" not anymore. of course this should also work the other way round when you then click on "relevence" again. i hope you get the idea!?
i managed to create this badly programmed script, but what isnt programmed here is the striking through:
<html>
<head>
<style type="text/css">
<!--
body {
text-align: left;
}
#fullDescrip {
width: 450px;
height: 200px;
border: solid #000000 2px;
margin: 0 auto;
text-align: justify;
padding: 20px;
}
#prodContainer .products {
margin: 10px;
border: solid #AAAAAA 1px;
width: 100px;
height: 100px;
}
#prodContainer2 .products {
margin: 10px;
border: solid #AAAAAA 1px;
width: 100px;
height: 100px;
}
-->
</style>
<script>
var rand = Math.floor(Math.random() * 2);//the number here must be the total number of products you have listed
var prod = new Array();
prod[0] = "<width='100' height='100'>changed here!";
prod[1] = "<width='100' height='100'>changed again!";
function loadProd(content){
document.getElementById('fullDescrip').innerHTML = content;
}
</script>
</head>
<body>
<div id="fullDescrip">
<script>
document.getElementById('fullDescrip').innerHTML = prod[rand];
</script>
</div>
<table id="prodContainer">
<tr>
<td>
<div id="prod1" class="products" onClick="loadProd(prod[0])">
button 1
</div>
</td>
<td>
<table id="prodContainer2">
<tr>
<td>
<div id="prod2" class="products" onClick="loadProd(prod[1])">
button 2
</div>
</td>
</body>
</html>
it would be awesome if you can help me here. since i am no programmer i'm not able to do it on my own...
thanks, tom