❶ ecshop購物車加減css樣式代碼怎麼樣添加
在style.css里添加下面樣式
.goods_cut{
background:url("../images/plus.gif")no-repeatscroll00transparent;
border:0none;
cursor:pointer;
display:block;
float:left;
font-size:0;
height:15px;
line-height:0;margin:8px3px0;
width:15px;
}
input.goodsBuyBox,input.number{
border:1pxsolid#DDDDDD;
float:left;
font-size:10px;
height:18px;
line-height:18px;
margin:5px6px0;
padding:0;
text-align:center;
width:32px;
}
.goods_add{
background:url("../images/plus.gif")no-repeatscroll0-15pxtransparent;
border:0none;
cursor:pointer;
display:block;
float:left;
font-size:0;
height:15px;
line-height:0;
margin:8px3px0;
width:15px;
}
在flow.dwt里,看各自的模板去修改,總之要找到這串代碼:
<input type="text" name="goods_number[{$goods.rec_id}]" ……
下面是腳本,放進flow.dwt里
<scriptlanguage="javascript"type="text/javascript">
functiongoods_cut($val){
varnum_val=document.getElementById('number'+$val);
varnew_num=num_val.value;
if(isNaN(new_num)){alert('請輸入數字');returnfalse}
varNum=parseInt(new_num);
if(Num>1)Num=Num-1;
num_val.value=Num;
document.getElementById('updatecart').click();
}
functiongoods_add($val){
varnum_val=document.getElementById('number'+$val);
varnew_num=num_val.value;
if(isNaN(new_num)){alert('請輸入數字');returnfalse}
varNum=parseInt(new_num);
Num=Num+1;
num_val.value=Num;
document.getElementById('updatecart').click();
}
</script>
找到
<input type="text" name="goods_number[{$goods.rec_id}]"
搜索不到你就搜goods_number就行了
替換為:
<spanclass="goods_cut"onclick="goods_cut('{$goods.rec_id}');"></span>
<inputtype="text"name="goods_number[{$goods.rec_id}]"id="number{$goods.rec_id}"value="{$goods.goods_number}"size="4"class="number"onblur="if(isNaN(this.value)){alert('請輸入數字');returnfalse}else{document.getElementById('updatecart').click();}"title="{$lang.goods_number_tip}"/>
<spanclass="goods_add"onclick="goods_add('{$goods.rec_id}');"></span>
找到
<input name="submit" type="submit" value="{$lang.update_cart}" class="btn_s3"/>
其實就是更新購物車的按鈕
添加一個id=「updatecart」
<input name="submit" type="submit" id="updatecart" value="{$lang.update_cart}" class="btn_s3"/>
❷ 如何用html css javascript php製作購物車
一兩句說不清楚………
用html css做出商品樣子和購物車樣子,
然後用javascript來對買這個動專作做處理,把商品的信屬息存起來,通過js把商品信息傳遞給購物車,讓購物車能夠顯示;
另一方面把信息交給php,寫入資料庫。
我這么說你明白了么……
❸ 求html購物車代碼,,效果如圖顯示
<htmlxmlns="http://www.w3.org/1999/xhtml">
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
<title>修改訂單</title>
<styletype="text/css">
body{
font-size:13px;
line-height:25px;
}
table{
border-top:1pxsolid#333;
border-left:1pxsolid#333;
width:400px;
}
td{
border-right:1pxsolid#333;
border-bottom:1pxsolid#333;
text-align:center;
}
.title{
font-weight:bold;
background-color:#cccccc;
}
inputtext{
width:100px;
}
</style>
<scripttype="text/javascript">
functionaddRow(){
//行的長度
varrowlength=document.getElementById("order").rows.length;
//得到整個表格對象
varorder=document.getElementById("order").insertRow(rowlength-1);
order.id=rowlength-1;
//插入列
varcel1=order.insertCell(0).innerHTML="游戲光碟";
varcel2=order.insertCell(1).innerHTML="34";
varcel3=order.insertCell(2).innerHTML="¥58.40";
varcel4=order.insertCell(3).innerHTML="<inputtype="button"value="刪除"onclick="delRow('"+(rowlength-1)+"')"/>"+"<inputtype="button"value="修改"onclick="editRow('"+(rowlength-1)+"')"/>"
}
functiondelRow(qwe){
=document.getElementById(qwe).rowIndex;
document.getElementById("order").deleteRow(ewq);
}
functioneditRow(rowID){
varrow=document.getElementById(rowID);
varcel=row.cells;
vartext=cel[1].innerHTML;
cel[1].innerHTML="<inputtype='text'value='"+text+"'style='width:40px;'>"
cel[3].lastChild.value="確定";
cel[3].lastChild.setAttribute("onclick","update('"+rowID+"')");
}
functionupdate(qwe){
varrow=document.getElementById(qwe);
varcel=row.cells;
vartext=cel[1].lastChild.value;
cel[1].innerHTML=text;
cel[3].lastChild.value="修改";
cel[3].lastChild.setAttribute("onclick","editRow('"+qwe+"')");
}
/*
functionadd(){
vara=document.getElementById("order").rows.length;
varb=document.getElementById("order").insertRow(a-1);
varone1=b.insertCell(0).innerHTML="123";
}
*/
</script>
</head>
<body>
<tableborder="0"cellspacing="0"cellpadding="0"id="order">
<trclass="title">
<td>商品名稱</td>
<td>數量</td>
<td>價格</td>
<td>操作</td>
</tr>
<trid="1">
<td>防滑真皮休閑鞋</td>
<td>12</td>
<td>¥568.50</td>
<td><inputname="rowdel"type="button"value="刪除"onclick='delRow("1")'/>
<inputid="edit1"type="button"value="修改"onclick='editRow("1")'/></td>
</tr>
<tr>
<tdcolspan="4"style="height:30px;">
<inputname="addOrder"type="button"value="增加訂單"onclick="addRow()"/></td>
</tr>
</table>
</body>
</html>
這個是我原來上學的時候練習的代碼,練習的是基礎的jsDOM操作,不過建議以後用Jquery 比較方便 有什麼不懂得可以問我
❹ 靜態HTML網頁可以實現購物車功能嗎而且不用資料庫...
沒有人會做來這樣的事自情,但是即然說了,可以討論一下
一般的購物車,都要有SESSION和COOKIES來做,在沒有服務端腳本語言的情況下操作SESSION是不可能的!
靜態HTML里如果可以用JAVASCRIPT腳本,就可以操作COOKIES,將商品的信息保存在COOKIES中,購買成功後,可以用:mailto:[email protected] 的方式發送到郵箱!
❺ css有什麼辦法可以做成這樣。有白色的購物車圖片只要加黑色的背景顏色就可以了
一般前端框架來有這種,比如源bootstrap這種,實際上它是把把個別字元設計成購物車圖形,類似於另外設置了字體,把圖片設計成字體。這種的優點是方便,可以隨意在css中自定義大小顏色。缺點是用戶瀏覽網頁的時候需要預先載入這種字體,一般瀏覽器都載入特別慢或者不成功,網頁上就會有個方框,並不友好。如果網頁上類似圖標很多的話可以用這種,如果不多不如直接用背景透明的矢量圖片,也可以達到你的要求
❻ CSS布局購物車,應該如何寫呀
絕對定位,想怎麼布局就怎麼布局!
❼ 想做一個簡單的購物車界面,非常簡單就行有代碼!用div+css做就可以
購物車外是可以的 但是核心最好還是用程序本來的核心如果自己寫,很有單獨
❽ 求一個JS代碼,就APP購物車的代碼,可以在html直接實現的
給樓主做了一個,JS實現商品計數的加和減,最少不能少於1,最多不大於99,代碼裡面有注釋,方面樓主查看和使用。
❾ 求助:用css寫類似淘寶購物車步驟條
1、首先是計算一行的價格。這個功能在上篇博客里有提到,這里就不列舉出來了。
2、遍歷選中的幾行,將每行的數值相加。
3、將值賦給總金額顯示出來。當取消勾選或加減數量時,金額會相應改變。
❿ 網站開始頭 LOGO 搜索欄 和那個 購物車 用DIV+CSS 代碼怎麼寫。怎麼讓他們 平行
浮動樣式控制三個部分就行了!或者用表格定位也行。浮動樣式控制三個部分就行了!或者用表格定位也行。