我需要幫助創建一個jQuery腳本。讓我首先解釋這個目標,這是一個Web應用程序,它在選擇基礎部件和頭部部件之後顯示自定義工具。這裏是我爲它創建的html。需要幫助創建一個jQuery腳本
<div>Base List</div>
<div id="baseSection">
<ul class="selectable">
<li id="a">1</li>
<li id="b">2</li>
<li id="c">3</li>
<li id="d">4</li>
</ul>
</div>
<div>Head List</div>
<div id="headSection">
<ul class="selectable">
<li id="1">1</li>
<li id="2">2</li>
<li id="3">3</li>
<li id="4">4</li>
<li id="5">5</li>
<li id="6">6</li>
<li id="7">7</li>
<li id="8">8</li>
</ul>
</div>
<!--//This content below will be hidden//-->
<div id="content-1">Custom tool 1</div>
<div id="content-2">Custom tool 2</div>
<div id="content-3">Custom tool 3</div>
<div id="content-4">Custom tool 4</div>
<div id="content-5">Custom tool 5</div>
<div id="content-6">Custom tool 6</div>
<div id="content-7">Custom tool 7</div>
<div id="content-8">Custom tool 8</div>
<div id="content-9">Custom tool 9</div>
<div id="content-10">Custom tool 10</div>
<div id="content-11">Custom tool 11</div>
<div id="content-12">Custom tool 12</div>
<div id="content-13">Custom tool 13</div>
<div id="content-14">Custom tool 14</div>
<div id="content-15">Custom tool 15</div>
<div id="content-16">Custom tool 16</div>
<div id="content-17">Custom tool 17</div>
<div id="content-18">Custom tool 18</div>
<div id="content-19">Custom tool 19</div>
<div id="content-20">Custom tool 20</div>
<div id="content-21">Custom tool 21</div>
<div id="content-22">Custom tool 22</div>
<div id="content-23">Custom tool 23</div>
<div id="content-24">Custom tool 24</div>
<div id="content-25">Custom tool 25</div>
<div id="content-26">Custom tool 26</div>
<div id="content-27">Custom tool 27</div>
<div id="content-28">Custom tool 28</div>
<div id="content-29">Custom tool 29</div>
<div id="content-30">Custom tool 30</div>
<div id="content-31">Custom tool 31</div>
<div id="content-32">Custom tool 32</div>
<!--//This div will not be hidden and will display the result//-->
<div id="displyContent"></div>
我需要腳本將頭部的base + id的點擊ID =一個自定義工具。例如,我作爲用戶選擇基地1,然後我選擇頭4,然後它顯示定製工具8.
任何幫助,將不勝感激!
爲什麼點擊基地1和頭部4給你工具8? – andyzinsser 2013-02-22 03:56:25
對不起,這是一個更清晰的例子。如果用戶選擇了base 1 + head 1 would =自定義工具1。基數爲1的ID爲A +頭1 ID爲1,如果A1爲真,則腳本將合併使其成爲A1的ID,然後在displyContent div內顯示自定義工具1。我希望更好地明確我想要完成的事情。 – Jon 2013-02-22 04:32:15