Buttons behavior between PC and Touch devices

Buttons behavior between PC and Touch devices

Basically I am a web designer and I don't know much about jQuery so I'm a little bit lost. I wrote some jQuery scripts to manage buttons but they don't have the behavior as I would like on PC and on Touch devices.

I have two families of buttons to manage. The "images" buttons (swap) and the CSS buttons (background color change).

I would like to disable the "hover" effect on Touch devices because it's mismanaged but keep the mouse clicks on Touch devices AND PC. But the drama is there.

Here is a model that I created: Model

Here is the mess I wrote:

  1. // Rollover on image 
  2. $(function() {
  3. $('img.rollover').on('mouseenter', function() {
  4. $(this).css("cursor", "pointer");
  5. this.src = this.src.replace("-normal", "-hover");
  6. });
  7. $('img.rollover').on('mouseleave', function() {
  8. this.src = this.src.replace("-hover", "-normal");
  9. });
  10. }); 

  11. // Toggles forms 
  12. $(function() {
  13. $("#form-contact").hide();
  14. $("#form-devis").hide();
  15. $("#btn-contact").click(function() {
  16. $(this).toggleClass("btn-form-hover");
  17. $("#form-contact").fadeToggle(500, "linear");
  18. $("#form-devis").hide();
  19. $("#btn-devis").removeClass("btn-form-hover");
  20. });
  21. $("#btn-devis").click(function() {
  22. $(this).toggleClass("btn-form-hover");
  23. $("#form-devis").fadeToggle(500, "linear");
  24. $("#form-contact").hide();
  25. $("#btn-contact").removeClass("btn-form-hover");
  26. });
  27. }); 

  28. // Toggle client area 
  29. $(function() {
  30. $("#div-client-area").hide();
  31. $("#btn-clients").click(function() {
  32. $("#div-home").toggle(500, "linear");
  33. $("#div-client-area").toggle(500, "linear");
  34. });
  35. });