Multi-conditional selection effect of jquery imitation Mall

Source: Internet
Author: User
Tags visibility
The code is as follows Copy Code
See Effect picture
The code is as follows Copy Code
The code is as follows Copy Code
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title> multi-conditional selection effect for shop use </title>
<meta http-equiv= "Content-type" content= "text/html;charset=gb2312" >
<!--Add the following code to <style type= "Text/css" >
*{padding:0;margin:0;}
body{font:12px "5b8b4f53", San-serif;color: #3e2d1b; background: #fff8e6 URL (/images/20121/151845/top.gif) repeat-x; Text-size-adjust:none;}
. Fl{float:left;}
. Fr{float:right;}
Ul,li{list-style:none;}
. Bk{font-size:1px;height:0;line-height:1px;display:block;clear:both;overflow:hidden;}
H1,h2,h3,h4,h5,h6,em,i{font-size:12px;font-weight:normal;}
. Cf{*zoom:1;}
. Cf:after{clear:both;height:0;overflow:hidden;display:block;visibility:hidden;content: ".";}
Em,cite,th,i,b,q,blockquote{font-style:normal;}
A{text-decoration:none;color: #3e2d1b;}
A:hover{text-decoration:underline;color: #8b631b;}
. Cf{*zoom:1;}
. Cf:after{clear:both;height:0;overflow:hidden;display:block;visibility:hidden;content: ".";}
. Solid_line{background:url (/effect/images/20121/151845/bg.gif) repeat-x 0-1125px;height:2px;
. Contsearch{background:url (/effect/images/20121/151845/contsearchc.gif) repeat-y;margin-bottom:8px;}
. Contsearch h4{float:left;font-weight:bold;font-size:14px;padding-left:18px;margin-right:10px;}
. Contsearch h4 a{padding:0 5px;}
. Contsearch. B{background:url (/effect/images/20121/151845/contsearchb.gif) no-repeat 0 100%;p adding-bottom:5px;
. Contsearch. c{padding:5px;}
. Contsearch. Title{background:url (/effect/images/20121/151845/contsearchtiitle.gif) no-repeat;height:38px; line-height:38px;}
. Contsearch h4{float:left;font-weight:bold;font-size:14px;padding-left:18px;}
. Contsearch h4 a{padding:0 5px;}
. Contsearch dl{padding:20px 0 0 120px;width:640px;position:relative;}
. Contsearch DL dt{text-align:right;width:110px;display:block;position:absolute;left:0;top:20px;}
. Contsearch DL dd{;}
. Contsearch DL DD a{padding:0 0 15px 0;display:block;width:25%;height:14px;overflow:hidden;outline:none;float:left;color: #255e00;}
. Contsearch DL DD A:hover{color: #dd3800;}
. Contsearch DL DD A.cur{color: #dd3800;}
. CONTSEARCHBTNWRAP{PADDING:9PX 0;}
. Contsearchbtnwrap Span{display:none;font-size:12px;background:url (/effect/images/20121/151845/bg.gif) no-repeat 100% -1803px;height:20px;padding-right:16px;text-align:center;margin:0 5px;float:left;position:relative;}
. Contsearchbtnwrap Cite{display:inline-block;background:url (/effect/images/20121/151845/bg.gif) no-repeat 0-1760px ; height:20px;line-height:20px;padding:0 5px;}
. Contsearchbtnwrap i{display:inline-block;width:16px;height:20px;overflow:hidden;position:absolute;top:0;right:0 ; cursor:pointer;}
. seachscroll{padding:4px 0 0;height:42px;padding:1px 0 0;height:45px;width:484px;float:left;color: #4b3a0e;}
* + HTML. seachscroll{padding:1px 0 0;height:45px;width:484px;float:left;color: #4b3a0e;}
* HTML. seachscroll{padding:1px 0 0;height:45px;width:494px;float:left;color: #4b3a0e;}
. Seachscroll. Scrollbg{height:8px;width:448px;background:url (/effect/images/20121/151845/scrollbg.gif) no-repeat 0-12px;margin : 0 0 0 9px;position:relative;}
. Seachscroll. SCROLLBG. Tip{display:inline-block;background:url (/effect/images/20121/151845/bg.gif) no-repeat 100% -1939px; Height:21px;float:left;position:absolute;left:-13px;top:-26px;padding-right:5px;color: #e7c6bd;}
. Seachscroll. SCROLLBG. Tip_l{display:inline-block;background:url (/effect/images/20121/151845/bg.gif) no-repeat 0-1905px; Padding-left:5px;height:21px;float:left;}
. Seachscroll. SCROLLBG. Tip_c{display:inline-block;background:url (/effect/images/20121/151845/scrollhovercbg.gif) no-repeat Center 0;height:21px;line-height:18px;float:left;}
. Seachscroll. SCROLLBG. Srcrollcurbg{background:url (/effect/images/20121/151845/scrollbg.gif) repeat-x 0 0;height:8px;position:absolute; Left:0;top:0;overflow:hidden;}
. Seachscroll. SCROLLBG. Tsdiv{width:484px;height:8px;overflow:hidden;position:absolute;left:0;top:0;z-index:999;overflow:hidden;}
. Seachscroll. SCROLLBG a{display:block;width:8px;height:8px;padding:0 18px;float:left;text-indent:-9999px;cursor:pointer;overflow:hidden;}
. Seachscroll. SCROLLBG a.cur{background-position:0 -38px;}
. Seachscroll. txtwrap{line-height:20px;height:20px;}
. Seachscroll I{display:block;width:24px;text-align:center;padding-right:20px;float:left;}
#Price_tip, #Discount_tip {float:left;width:100px;padding-top:5px;overflow:hidden;cursor:pointer;}
#Price_tip: Hover, #Discount_tip: hover{text-decoration:none;}
</style>
<script src= "/effect/images/20121/151845/jquery-1.4.2.min.js" type= "Text/javascript" ></script>
<body>
Preview the effect of the bottom left corner will be prompted with errors, and can not see the effect, refresh to see the effect of, of course, in the actual use, there will not be such a problem. <br>
<!--Add the following code to <body> and </body>-->
<div style= "WIDTH:772PX; margin:0 Auto ">
<div class= "Contsearch CF" >
<div class= "B" >
<div class= "title" >
<span class= "FL" > You have selected:</span>
<div class= "Contsearchbtnwrap" >
<span><cite id= "Web_text" ></cite><i></i></span>
<span><cite id= "Type_text" ></cite><i></i></span>
<span><cite id= "Discount_text" ></cite><i></i></span>
<span><cite id= "Price_text" ></cite><i></i></span>
</div>
</div>
<div class= "C" >
<dl>
<dt> Select:</dt> by website
<dd id= "Web" ><a href= javascript:void (0); "rel=" 1 "hidefocus=" true "> by Web site 1</a> <a" Javascript:void (0); "rel=" 2 "hidefocus=" true "> by website Select 2</a> <a href=" javascript:void (0); "rel=" 3 "Hidefocus = "true" > select 3</a> <a href= by Web site javascript:void (0); "rel=" 4 "hidefocus=" true "> by Web site 4</a> <a href = "Javascript:void (0);" rel= "5" hidefocus= "true" > by website Select 5</a> <a href= "javascript:void (0);" rel= "6" Hidefocus= "true" > select 6</a></dd> by Site
</dl>
<span class= "BK Solid_line" ></span>
<dl>
<dt> Select:</dt> by product category
<dd id= "Type" ><a href= "javascript:void (0);" rel= "1" hidefocus= "true" > select by product category 1</a> <a " Javascript:void (0); "rel=" 2 "hidefocus=" true "> by commodity category 2</a> <a href=" javascript:void (0); "rel=" 3 " Hidefocus= "true" > select 3</a> <a by commodity category href= "javascript:void (0);" rel= "4" hidefocus= "true" > by product category 4</a > <a href= "javascript:void (0);" rel= "5" hidefocus= "true" > by commodity type 5</a> <a href= "javascript:void (0);" Rel= "6" hidefocus= "true" > select by Product category 6</a></dd>
</dl>
<span class= "BK Solid_line" ></span>
<dl>
<dt> Select:</dt> by discount range
<dd id= "Discount" >
<div class= "Seachscroll" >
<div class= "SCROLLBG" >
<div class= "Tip" ><div class= "tip_l" ><div class= "Tip_c" > Unlimited </div></div></div>
<div class= "SRCROLLCURBG" ></div>
<div class= "Tsdiv" >
<a href= "javascript:void (0);" rel= "0" style= "padding-left:0;" hidefocus= "true" >0</a><a href= " Javascript:void (0); "rel=" 1 "hidefocus=" true ">1</a><a href=" javascript:void (0); "rel=" 2 "hidefocus=" True ">2</a><a href=" javascript:void (0); "rel=" 3 "hidefocus=" true ">3</a><a href=" javascript : void (0); "rel=" 4 "hidefocus=" true ">4</a><a href=" javascript:void (0); "rel=" 5 "hidefocus=" true ">5 </a><a href= "javascript:void (0);" rel= "6" hidefocus= "true" >6</a><a href= "javascript:void (0);" Rel= "7" hidefocus= "true" >7</a><a href= javascript:void (0); "rel=" 8 "hidefocus=" true ">8</a> <a href= "javascript:void (0);" rel= "9" hidefocus= "true" >9</a><a rel= "a" hidefocus= "true" >10</a >
</div>
</div>
<div class= "Txtwrap" >
<i> No Limit </i><i>1</i><i>2</i><i>3</i><i>4</i><i> 5</i><i>6</i><i>7</i><i>8</i><i>9</i><i>10</i >
</div>
</div>
<a id= "Discount_tip" class= "FL" ></a>
</dd>
</dl>
<span class= "BK Solid_line" ></span>
<dl>
<dt> Select:</dt> by saving amount
&LT;DD id= "Price" >
<div class= "Seachscroll" >
<div class= "SCROLLBG" >
<div class= "Tip" ><div class= "tip_l" ><div class= "Tip_c" > Unlimited </div></div></div>
<div class= "SRCROLLCURBG" ></div>
<div class= "Tsdiv" >
<a href= "javascript:void (0);" rel= "0" style= "padding-left:0;" hidefocus= "true" >0</a><a href= " Javascript:void (0); "rel=" 1 "hidefocus=" true ">50</a><a href=" javascript:void (0); "rel=" "hidefocus=" True ">100</a><a href=" javascript:void (0); "rel=" hidefocus= "true" >150</a><a href= " Javascript:void (0); "rel=" "hidefocus=" true ">200</a><a href=" javascript:void (0); "rel=" 300 " Hidefocus= "true" >300</a><a href= "javascript:void (0);" rel= "hidefocus=" true ">400</a>< A href= "javascript:void (0);" rel= "hidefocus=" true ">500</a><a href=" javascript:void (0); "rel=" 700 " Hidefocus= "true" >700</a><a href= javascript:void (0); "rel=" 1000 "true" >1000</a> <a href= "javascript:void (0);" rel= "hidefocus=" true ">2000</a>
</div>
</div>
<div class= "Txtwrap" >
<i> No Limit </i><i>50</i><i>100</i><i>150</i><i>200</i> <i>300</i><i>400</i><i>500</i><i>700</i><i>1000</i ><i>2000</i>
</div>
</div>
<a id= "Price_tip" style= "Float:left" ></a>
</dd>
</dl>
<form action= "" method= "get" >
<input type= "hidden" value= "0" id= "Web_val" >
<input type= "hidden" value= "0" id= "Type_val" >
<input type= "hidden" value= "0" id= "Discount_val" >
<input type= "hidden" value= "0" id= "Price_val" >
</form>
<span class= "BK" ></span>
</div>
</div>
</div>
</div>
<script type= "Text/javascript" >
$ (function () {
var Btn = $ ('. Contsearch dd a ');
function Tsfn (obj,type) {
var Scroll = $ (obj). Closest ('. SCROLLBG '). Find ('. SRCROLLCURBG ')
var tsname = $ (obj). Closest (' DD '). attr (' id ')
var tsval = $ (obj). attr ("rel");
var tswidth = $ (obj). innerwidth ();
var Tstip = $ (obj). Closest ('. SCROLLBG '). Find ('. Tip ');
if ($ (obj). Index () ==0) {
var tsindex = 1;
var tswidth = 8;
var scrollwidth = Tswidth*tsindex
}else{
var Tsindex = $ (obj). index ();
var scrollwidth = (tswidth*tsindex) +8;
}
if (type== ' Tsclick ') {
Scroll.stop (true,true). Animate ({width:scrollwidth+ ' px '},1000);
if (tsname== "Discount") {
$ (' # ' +tsname+ ' _text '). Empty (). Append (tsval+ ' fold '). Closest (' span '). CSS ({display: ' Inline-block '});
$ (' # ' +tsname+ ' _tip '). html (tsval+ ' folded ');
$ (' # ' +tsname+ ' _val '). Val (TSval);
}else if (tsname== "price") {
$ (' # ' +tsname+ ' _text '). Empty () Append (' Save ' +tsval+ ' yuan '). Closest (' span '). CSS ({display: ' Inline-block '});
$ (' # ' +tsname+ ' _tip '). html (tsval+ ' above ');
$ (' # ' +tsname+ ' _val '). Val (TSval);
}else{
var tshtml = $ (obj). html ();
$ (' # ' +tsname+ ' _text '). Empty (). Append (tshtml). Closest (' span '). CSS ({display: ' Inline-block '});
$ (' # ' +tsname+ ' _val '). Val (TSval);
}
}else if (type== ' Tshover ') {
Tstip.find ('. Tip_c '). HTML (tsval)
var tstipwidth = scrollwidth-4-(Tstip.innerwidth ()/2);
Tstip.stop (true,true). Animate ({left:tstipwidth+ ' px '},1000);
}
}
$ (BTN).-A (). css ({' padding-left ': ' 0 '});
Btn.click (function () {
TSFN ($ (this), ' Tsclick ');
});
Btn.mouseenter (function () {
TSFN ($ (this), ' tshover ');
})
var closebtn = $ ('. Contsearchbtnwrap i ');
$ (CLOSEBTN). Click (function () {
var Closename = $ (this). Prev (' cite '). attr (' id '). Slice (0,-5);
var Scroll = $ (' # ' +closename). Find ('. SRCROLLCURBG ');
var Tstip = $ (' # ' +closename). Find ('. Tip ');
$ (' # ' +closename+ ' _text '). Closest (' span '). Hide ();
Tstip.stop (true,true). Animate ({left: ' -13px '},1000). Find ('. Tip_c '). html (' unlimited ');
$ (' # ' +closename+ ' _val '). Val (0);
Scroll.stop (true,true). Animate ({width:0},1000);
});
});
</script>
</body>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.