The code you've found will not help you. There are a whole bunch of reasons why code like this is a bad idea in most cases, but even ignoring that fact, this block of code won't fix anything by itself; it is only a tool to help you write other code that will fix the problem.
You need to actually work out what the difference is. IE10 and IE11 are fairly good browsers when it comes to rendering things correctly, so my guess is that most likely somewhere in your code you're using a feature that wasn't available in IE10 and was only introduced for IE11, and this is why it's not working in IE10.
A couple of lines to detect the browser version won't do anything to resolve that. You'll still need to work out what feature (or features) you're using that aren't working, and how to get around it.
When you've worked that out, come back and ask for further help if you need it.