Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <script>
  2. function is_touch_device() {
  3. return !!('ontouchstart' in window);
  4. }
  5.  
  6.  
  7. jQuery(document).ready(function() {
  8. if (is_touch_device()) {
  9. jQuery('.level-top > a').each(function(index, elem) {
  10. var link_value = jQuery(this).attr("href");
  11.  
  12. jQuery(this).on('click', function(e) {
  13. alert(jQuery(this).attr("data-click"));
  14. jQuery(this).attr("data-click") == undefined;
  15. if (jQuery(this).attr("data-click") == undefined) {
  16. jQuery(this).attr("data-click", 1);
  17. jQuery(this).attr('href', '#');
  18. } else if (jQuery(this).attr("data-click") == 1) {
  19. jQuery(this).attr('href', link_value);
  20. }
  21.  
  22. });
  23. });
  24.  
  25. }
  26. });
  27. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement