If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

How to make any link not clickable

Sometimes you may need to lock some link, for example you do not pant one of your blog posts to open anything, but you still want others to work properly. In this case you will need to embed jQuery scripting to lock button link.

In this tutorial you will learn the way to lock any button with jQuery, you can use this method anywhere in the web. 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 template and locate link you want to stop working and find out exact path by elements (you may use Firebug or any other web developing plugin to locate exact location of your link, you may also view website structure to find it out), e.g:
    	.K2ItemsRow .itemContainer .catItemView .catItemHeader .catItemTitle a

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

  2. When you know proper selectors you need to open your index.html file (HTML templates) or and other file to add jQuery and paste similar script:
    				<script>
    				jQuery(document).ready(function(){
    	                           jQuery('.K2ItemsRow .itemContainer .catItemView .catItemHeader .catItemTitle a').click(function(){
        	                              return false; // prevents default action
                              	    });
                                    });
    				</script>
    				

    As you can see we’ve used our previous example as link selector, but you will need to replace with your link details:

    	.K2ItemsRow .itemContainer .catItemView .catItemHeader .catItemTitle a

    Usually you can paste this scripting everywhere in the template but some CMS systems may block the scripting in case you paste it in the incorrect place so If you have any problems using this scripting please contact us.

  3.  

    How to make any link not clickable, 1.0 out of 5 based on 2 ratings