<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
\t <script>
\t $(document).ready(function(){
\t $("#showrightcornerbumper").click(function(){
\t $("#first").toggle();
\t });
\t });
\t </script>
\t
\t <script>
\t $(document).ready(function(){
\t $("#showleftcornerbumper").click(function(){
\t $("#second").toggle();
\t });
\t });
\t </script>
\t <script>
\t $(document).ready(function(){
\t $("#backbumper").click(function(){
\t $("#third").toggle();
\t });
\t });
\t </script>
\t <script>
\t $(document).ready(function(){
\t $("#boot").click(function(){
\t $("#fourth").toggle();
\t });
\t });
\t </script>
\t <script>
\t $(document).ready(function(){
\t $("#leftrearquaterpanel").click(function(){
\t $("#fifth").toggle();
\t });
\t });
\t </script>
\t <script>
\t $(document).ready(function(){
\t $("#rightrearquaterpanel").click(function(){
\t $("#sixth").toggle();
\t
\t });
\t });
\t </script>
\t <script>
\t \t $(function() {
\t \t $("#showleftcornerbumper").on("click", function() {
\t \t var text = $("#text");
\t \t text.val(text.val() + " an estimate for this type of repair would be €200");
\t \t });
\t \t });
\t </script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<img src="images/car.png" usemap="#carmap">
\t <map name="carmap">
\t \t <area shape="rect" coords="30,282,50,302" id="showleftcornerbumper" href="#" alt="Left corner bumper" alt="Left Corner Bumper">
\t \t <area shape="rect" coords="230,282,247,300" id="showrightcornerbumper" href="#" alt="Right Corner Bumper">
\t \t <area shape="rect" coords="91,301,187,306" id="backbumper" href="#" alt="Back Bumper">
\t \t <area shape="rect" coords="93,267,187,297" id="boot" href="#" alt="Boot">
\t \t <area shape="rect" coords="53,250,76,297" id="leftrearquaterpanel" href="#" alt="Left rear quater panel">
\t \t <area shape="rect" coords="202,251,226,299" id="rightrearquaterpanel" href="#" alt="Right rear quater panel">
\t </map>
\t
\t <p id="first" style="display:none;">The cost of this repair is €200.</p>
\t <p id="second" style="display:none;">The cost of this repair is €300.</p>
\t <p id="third" style="display:none;">The cost of this repair is €300.</p>
\t <p id="fourth" style="display:none;">The cost of this repair is €300.</p>
\t <p id="fifth" style="display:none;">The cost of this repair is €300.</p>
\t <p id="sixth" style="display:none;">The cost of this repair is €300.</p>
<form action="action_page.php">
\t First name:<br>
\t <input type="text" value="">
\t <br>
\t Email:<br>
\t <input type="Email" name="lastname" value="" id="email">
\t <br>
\t Quote:<br>
\t <input type="text" value="Thank you for your interest in Smart Repair" id="text" size="100" />
\t <br />
\t <input type="button" value="Click Me" id="button" />
</form>
我嘗試重新類似於以下https://revive-uk.com/get-a-quick-quote/修復計算器中的某一部分上去除一個字符串到表單字段,我在圈子裏走,我有基本的HTML,CSS,jQuery和js知識。我希望能夠通過點擊區域或打開和關閉來突出顯示汽車的不同部分。在閱讀論壇後,我相信它最好從一個圖像中完成。
可以用圖像映射和maphighlighter插件相當容易地做到這一點,或轉換爲svg。谷歌搜索應該能夠產生各種方法 – charlietfl
嗨!請用代碼exmaples提問 – elicohenator
一個好方法是使用SVG並使用jQuery隨時修改它 – Qrchack