Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <div mnt-watch-product="ZAL-BE-DP521I09O-K11">
  2. <button type="button" onclick="Monotote.show('ZAL-BE-DP521I09O-K11')">View details</button>
  3. <span>The product is not available</span>
  4. </div>
  5. <script>
  6. // define `_mnt` with a `publisherKey`
  7. _mnt.onReady = function(){
  8. Monotote.on("watch-product-availability-state-change", function(info){
  9. // it contains `element` and `available` properties
  10. info.element.className = info.available ? '' : 'disable-product';
  11. });
  12. }
  13. </script>
  14. <style>
  15. div span {
  16. display: none;
  17. }
  18. div.disable-product button {
  19. display: none;
  20. }
  21. div.disable-product span {
  22. display: initial;
  23. }
  24. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement