New Post - Reply - Locked buttons with text instead of an image
3 posters
Page 1 of 1
New Post - Reply - Locked buttons with text instead of an image
Well, hello! I was surfing the web and found a JS code that allows to transform the topic buttons into text that can be stylized with CSS. Theorically this code was taken from here but I couldn't find the topic. The code in this case is:
So, I tested it with the New Topic and the Reply buttons, and it works magically. There's just one little thing that bugs me: I have no idea about how to make it change the Locked/Closed Theme button. When I took a look at the class of the icon I found that it's just the same as the New Topic or Reply one, so... I totally lost it. It's really not a hard issue but if there's any way to make it work...
Anyone has some idea that could help? I'm kind of a newbie in the area, so a little help would be appreciated.
I hope I'm being clear enough here. Thanks!
- Code:
jQuery(document).ready(function() {
$('.icon class').replaceWith('<div class="name of the div in the CSS">Text</div>');
});
So, I tested it with the New Topic and the Reply buttons, and it works magically. There's just one little thing that bugs me: I have no idea about how to make it change the Locked/Closed Theme button. When I took a look at the class of the icon I found that it's just the same as the New Topic or Reply one, so... I totally lost it. It's really not a hard issue but if there's any way to make it work...
Anyone has some idea that could help? I'm kind of a newbie in the area, so a little help would be appreciated.
I hope I'm being clear enough here. Thanks!
Last edited by Kalopsia on August 29th 2017, 7:06 pm; edited 1 time in total
Re: New Post - Reply - Locked buttons with text instead of an image
Hi there, what is your forum's version?
Re: New Post - Reply - Locked buttons with text instead of an image
You can make it something like this to notify when you are using the locked button instead of the post reply button by checking what the "alt" attribute says since the system doesn't have a specific class for locked buttons.
- Code:
$(function() {
$("img.i_post").replaceWith('<div class="image_post">Post</div>');
var x = $("img.i_reply").attr("alt");
// check for locked button
if (x == "This topic is locked: you cannot edit posts or make replies.") {
$("img.i_reply").replaceWith('<div class="image_locked">Locked</div>');
} else {
$("img.i_reply").replaceWith('<div class="image_reply">Reply</div>');
}
});
Re: New Post - Reply - Locked buttons with text instead of an image
Oh, I'll try this and edit this post to notify if it works or not, thank you!
EDIT: It worked! You're a wonder! Thank you veeeeeeeeeeeeery much!
For future investigators, this same code works for the quote/edit/delete/ip buttons, however, in my limited knowledge I couldn't make it work in the Reply PM button or the quote/edit PM buttons either. But to me this is solved, so I'll mark it.
Thanks again Draxion!
EDIT: It worked! You're a wonder! Thank you veeeeeeeeeeeeery much!
For future investigators, this same code works for the quote/edit/delete/ip buttons, however, in my limited knowledge I couldn't make it work in the Reply PM button or the quote/edit PM buttons either. But to me this is solved, so I'll mark it.
Thanks again Draxion!
Re: New Post - Reply - Locked buttons with text instead of an image
Problem solved & topic archived.
|
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.
Similar topics
» When onclick button of "Post Reply" scroll down to the quick reply
» How to change "Post Buttons" from image to text
» Hi Everyone! ~Post Reply, New Topic, Locked~
» New Post and Reply locked for all member and moderators
» Replace folder image with a text (folder image = image od topics, new topics, and locked topics of the categories and forums)
» How to change "Post Buttons" from image to text
» Hi Everyone! ~Post Reply, New Topic, Locked~
» New Post and Reply locked for all member and moderators
» Replace folder image with a text (folder image = image od topics, new topics, and locked topics of the categories and forums)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum