Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function is_touch_device() {
- return !!('ontouchstart' in window);
- }
- jQuery(document).ready(function() {
- if (is_touch_device()) {
- jQuery('.level-top > a').each(function(index, elem) {
- var link_value = jQuery(this).attr("href");
- jQuery(this).on('click', function(e) {
- alert(jQuery("a").attr("data-click"));
- if (jQuery("a").attr("data-click") == undefined) {
- jQuery("a").attr("data-click", 1);
- jQuery(this).attr('href', '#');
- }
- else if (jQuery("a").attr("data-click") == 1) {
- jQuery(this).attr('href', link_value);
- }
- });
- });
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement