Select Content Mess up [Help Needed]
3 posters
Page 1 of 1
Select Content Mess up [Help Needed]
As you can see the (code)(/code) is not working right in my posts. It carrys on to everything after and is also throwing in a border which shouldn't be there as its not even being placed around the code selection table.
Would be nice if someone had a theory of how to fix this.
Last edited by Khaoz on July 23rd 2013, 5:12 pm; edited 1 time in total
Khaoz- Forumember
- Posts : 48
Reputation : 4
Language : English
Re: Select Content Mess up [Help Needed]
Can you please post a link to a thread on your forum using the code tags, so I may have a look?
Re: Select Content Mess up [Help Needed]
*Removed to keep website off forums
Last edited by Khaoz on July 23rd 2013, 5:14 pm; edited 1 time in total
Khaoz- Forumember
- Posts : 48
Reputation : 4
Language : English
Re: Select Content Mess up [Help Needed]
Try replacing your current select content code with the one below.
Also if you wish to remove the borders use this:
Though It may be something in your CSS or templates that could be causing this. As I found 'span .postbody' where the border content is.
- Code:
function selectCode(a)
{
// Get ID of code block
var e = jQuery(a).closest('tr').next().find('.cont_code')[0];
// Not IE
if (window.getSelection)
{
var s = window.getSelection();
// Safari
if (s.setBaseAndExtent)
{
s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
}
// Firefox and Opera
else
{
// workaround for bug # 42885
if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
{
e.innerHTML = e.innerHTML + ' ';
}
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
}
// Some older browsers
else if (document.getSelection)
{
var s = document.getSelection();
var r = document.createRange();
r.selectNodeContents(e);
s.removeAllRanges();
s.addRange(r);
}
// IE
else if (document.selection)
{
var r = document.body.createTextRange();
r.moveToElementText(e);
r.select();
}
}
jQuery(function(){
jQuery('div.postbody td.code').parent().prev().find('b').html('Code:
<a href="javascript:void()" onClick="selectCode(this)"><font
face="verdana" color="red"></font> Select Content </a>');
});
Also if you wish to remove the borders use this:
- Code:
.code {
border: 0px;
}
Though It may be something in your CSS or templates that could be causing this. As I found 'span .postbody' where the border content is.
Re: Select Content Mess up [Help Needed]
I managed to fix it by removing this from my css but the code you gave .code didnt seem to work without having to remove v
- Code:
.postbody {
font-size: 12px;
line-height: 18px;
-moz-border-radius: 2px 2px 2px 2px; border: 2px solid rgb(24,24,24); outline: 1px solid rgb(17, 17, 17); padding: 5px; color: rgb(255, 255, 255);
}
Khaoz- Forumember
- Posts : 48
Reputation : 4
Language : English
Re: Select Content Mess up [Help Needed]
Very good that you removed the cause, I had doubts of the select code causing it after inspection.
from previous editing
https://i.servimg.com/u/f37/18/21/41/30/ex110.png
Code does not seem to be the problem at all which is good.
from previous editing
https://i.servimg.com/u/f37/18/21/41/30/ex110.png
Code does not seem to be the problem at all which is good.
Re: Select Content Mess up [Help Needed]
Topic Solved & Locked
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum