- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
How to make any link not clickable
August 3, 2012
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.
- 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. - 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:
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.