The problem: We have a new UI with a plug n play type option boxes. (eg. Size, color, shape) when I select a size - let's say medium for example it will display the selection and the options box will disappear. Most likely on a pageload. It will then display an edit option next to it in case the user changes his/her mind.
Here is the example form I am using...
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CPI Purchase PNP Options</title>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="assets/css/reset.css" media="screen">
<link rel="stylesheet" type="text/css" href="assets/css/custom.css" media="all">
<script src="assets/js/pnp.js"></script>
<meta name="generator" content="">
</head>
<body>
<div id="container">
<header>
<nav>
</nav>
</header>
<section id="review-cart">
<table class="cart-contents">
<tr class="background">
<td colspan="5"> </td>
</tr>
<tr>
<th class="th item">Item</th>
<th class="th unit-price">Unit Price</th>
<th class="th quantity">Quantity</th>
<th class="th subtotal">Subtotal</th>
</tr>
<tr>
<td class="item">Test Tangible
<div class="options">
<span>Size: <br />
<select name="option_0_173244530" id="pnp-option">
<option value="Choose">Choose</option>
<option value="173244550">small - .99</option>
<option value="173244570">Medium - 1.00</option>
<option value="173244590">Large - 2.00</option>
</select>
</span>
<a class="update" href="#">Update</a><br />
<span>Color:<br />
<select name="option_0_3904622337" id="pnp-option">
<option value="Choose">Choose</option>
<option value="173244700">Red</option>
<option value="173244720">Blue</option>
<option value="173244740">Green</option>
</select>
</span>
<a class="update" href="#">Update</a>
</td>
<td class="unit-price">€0.09</td>
<td class="quantity"><input value="1" name="product_index_0" maxlength="3" type="number" min="1" max="999">
<a class="update" href="#">Update</a>
</td>
<td class="subtotal">€0.09</td>
</tr>
</table>
<p>Pick Me, Pick Me!</p>
</section>
<footer>
</footer>
</div><!-- #site-wrapper -->
</body>
</html>
Some basic CSS
#container #review-cart table {
font-size: 12px;
margin-bottom: 60px;
position: relative;
width: 100%;
}
table {
border-collapse: seperate;
border-spacing: 0;
}
#container #review-cart table .background {
background: #6F889B;
left: 0;
opacity: 0.15;
position: absolute;
top: 0;
width: 100%;
}
#container #review-cart table .background td {
height: 30px;
margin: 0;
padding: 0;
}
#container #review-cart table .item {
font-weight: bold;
max-width: 45%;
width: 45%;
}
#container #review-cart table .unit-price {
max-width: 15%;
text-align: right;
width: 15%;
}
#container #review-cart table .quantity {
max-width: 20%;
text-align: right;
width: 20%;
}
#container #review-cart table .subtotal {
font-weight: bold;
max-width: 15%;
text-align: right;
width: 15%;
}
#container #review-cart table td.item {
line-height: 18px;
}
#container #review-cart table .item .options {
color: #6C6C6C;
font-size: 11px;
font-weight: bold;
line-height: 14px;
margin-top: 5px;
}
#container #review-cart table .item .options span {
display: inline-block;
max-width: 210px;
overflow: hidden;
}
#container #review-cart table .item .options select {
font-size: 11px;
margin: 0 5px;
}
#container #review-cart table tr td {
border-top: 1px solid #E2E2E2;
font-size: 13px;
height: 30px;
line-height: 30px;
padding: 10px 10px 5px;
}
caption, td, td {
font-weight: normal;
text-align: left;
}
And the Jquery I started using
$(document).ready(function() {
$("option").click(function() {
$(this).hide();
});
});
The Jquery is way off of course and what I am looking for here is a start to this not necessarily the answer to my problem. I have limited JQuery experience and I have yet to find a ecommerce site or website that does something similar for guidance.
Any suggestions are greatly appreciated
Thanks in advance

New Topic/Question
Reply



MultiQuote




|