Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work in progress on cut & code for elance storey
- Loading branch information
lcaraccioli
committed
Apr 27, 2012
1 parent
38a5d4f
commit 52f1575
Showing
4 changed files
with
144 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,44 @@ | ||
/* put your css here */ | ||
body{ | ||
font-family:sans-serif; | ||
} | ||
|
||
#content-wrapper{ | ||
width:80%; | ||
margin-left:10%; | ||
} | ||
|
||
#title{ | ||
display:block; | ||
border-bottom:3px solid #000; | ||
} | ||
|
||
#left-column{ | ||
width:50%; | ||
float:left; | ||
} | ||
|
||
#right-column{ | ||
width:50%; | ||
float:left; | ||
} | ||
|
||
#left-column label{ | ||
display:block; | ||
font-weight:bold; | ||
} | ||
|
||
#shopping-cart{ | ||
border:3px solid #CCC; | ||
|
||
} | ||
|
||
#shopping-cart th{ | ||
background-color:#CCC; | ||
font-size:.7em; | ||
} | ||
|
||
#product-image{ | ||
width:300px; | ||
height:303px; | ||
background-repeat:no-repeat; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,39 @@ | ||
//Javascript file for question #5 | ||
//MooTools documentation can be found at www.mootools.net | ||
//MooTools documentation can be found at www.mootools.net | ||
function init(){ | ||
var myRequest = new Request({ | ||
url:'processAHR.php?action=load', | ||
format:'json', | ||
onSuccess:function(responseText){ | ||
var jsonResponse = JSON.decode(responseText); | ||
Array.each(jsonResponse.categories, function(item,index,object){ | ||
var option = new Element('option', {value:index}); | ||
option.appendText(item); | ||
$('category').appendChild(option); | ||
$('category').addEvent('change', function(){ | ||
$('item').getElements('option').destroy(); | ||
var catid = $('category').get('value'); | ||
Array.each(jsonResponse.storeData, function(item,index,object){ | ||
if (catid == item.catid){ | ||
var option = new Element('option', {value:item.item_id}); | ||
option.appendText(item.name); | ||
$('item').appendChild(option); | ||
} | ||
|
||
}); | ||
$('item').fireEvent('change'); | ||
}); | ||
$('item').addEvent('change', function(){ | ||
var itemId = $('item').get('value'); | ||
var product = jsonResponse.storeData[itemId-1]; | ||
$('description').set('html',product.description); | ||
$('product-image').setStyle('background-image', 'url('+product.image+')'); | ||
}); | ||
}); | ||
$('category').fireEvent('change'); | ||
} | ||
}); | ||
myRequest.send(); | ||
}; | ||
|
||
window.addEvent('domready',init); |