search

Home  >  Q&A  >  body text

javascript - Select different packages to display corresponding prices for products

The three prices below the picture are the three package prices. I want to realize that by clicking on any of the three package prices, the default price of 980 above will also change. . How to implement it in JS?
< /p>

为情所困为情所困2807 days ago769

reply all(7)I'll reply

  • 阿神

    阿神2017-05-16 13:14:00

    Can I understand that this is a tab switch? When you click on the current color, you get the price above and put it below?

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-16 13:14:00

    Give you ideas

    Add the corresponding price to each color block
    Get the price when you click it, and then replace the price on the title.

    All are implemented by the front end.

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-16 13:14:00

    ajax. Click once to request once.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-16 13:14:00

    Different specifications display different prices. It should be that when the page is loaded, the prices of different specifications of all products have been obtained. When users click on different specifications, they only need to switch the data. There is no need to obtain it in the background, which puts a lot of pressure on the server. , the experience is not good, just one price data, right? And after the product is put on the shelf, the price is generally not allowed to be modified, unless the lower level is re-edited and then put on the shelf. However, the final price must still be based on the backend, which needs to verify the price. Effectiveness. The specific implementation should be to put the price of the modified product on the specification label attribute when initializing the specifications.

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-16 13:14:00

    Isn’t it very convenient to use emmy_’s method and jquery’s data-*?

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-16 13:14:00

    Multi-dimensional implementation http://www.cnblogs.com/puredi..., your single-dimensional one is even simpler

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-16 13:14:00

    It must be ajax in the official project

    reply
    0
  • Cancelreply