Categories

Featured templates

JS Animated. How to make any link non-clickable

Kate Daniels August 25, 2015
Rating: 5.0/5. From 2 votes.
Please wait...

This tutorial will show you how to make link non-clickable by using jQuery scripting.

JS Animated. How to make any link non-clickable

Note that this method works cross-browser and it is extremely useful for CMS systems when you can’t add some structural changes via files.

  1. Open your website and locate the link you want to stop working and find out its exact path by elements (you may use Firebug or any other web development plugin to locate exact location of your link, you may also view website structure to find it out), e.g:

    .list li a
    How_to_make_any_link_not_clickable

    This is regular CSS path, you are using the same selectors for CSS styling.

  2. When you find proper selectors, you should open your .HTML file (for HTML templates) or any .JS file (for CMS templates) to add jQuery and paste similar script:

    <script>
      jQuery(document).ready(function(){
    	  jQuery('.list li a').click(function(){
    	  return false; // prevents default action
    	  });
      });
      </script>
  3. If your template is CMS based, you can add script to one of js files located in your theme folder.

  4. Refresh the page to see changes.

Feel free to check the detailed video tutorial below:

JS Animated. How to make any link non-clickable
This entry was posted in JS Animated tutorials and tagged click, HTML, link, non-clickable. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket