October 2017
Intermediate to advanced
370 pages
8h 57m
English
We can use another amp-selector to set up our size option. It's very similar to the male or female style option selector we just saw. This one will have three options:
<amp-selector class="style-chooser" on="select:AMP.setState({product: {size: event.targetOption}})" > <span class="small" option="s" selected>S</span> <span class="medium" option="m" >M</span> <span class="large" option="l">L</span></amp-selector>
This time, AMP.setState({product: {size: event.targetOption}} will set the current size to the option just selected.
Read now
Unlock full access