Facebook Like Button - javascript

Is there a way to change the text next to the Facebook Like button to white, instead of the "#808080" color it is set to?

The only thing you can change (on the text) is the colorscheme. either 'light' or 'dark'.
You can change the background color of the iframe. But not the text in CSS style... unfortunately.

The class of the Like button is like_link stat_elem as_link, but I'm not seeing any #808080 deceleration. I'll post some working code once I find it.

Related

CSS cursor style override automatically?

Image link- scss style issue
I tried to change cursor style from pointer to default. But when I save the file and reload react app, the style is not changing. Tried to write code but SO keeps showing a message, guess I am doing it wrong.
When I inspect the element, the cursor default stile has been stiked through and a blue tick was appeared near cursor pointer , which was not even in my code.
Please check the image link above.
In the image attached you have a typo, should be cursor: default not dafault.
If the style is strike-through it means your style got overridden after.
Try to use the !important attribute:
cursor: default !important;

How do I change the default text highlighting color in Summernote?

I'm building a Rails app capable of displaying text with rich formatting - the app will be used by non-technical personnel, so using markdown is not possible.
Therefore, I've decided to use Summernote as a WYSIWYG editor.
However, the default highlighting color (the background color option) that is shown when the summernote is initialized is yellow which really conflicts with the color scheme of my app. Any idea how I can reset it so that the default color is whatever I want it to be?
I thought of editing the CSS class to have the correct coloring, but it appears that Summernote applies background color styles via inline style tags - not the best for editability.
If I can't change the default color, then any way that I can force-change the color using some other custom JS?
Update:
I dug into the page source and found that Summernote uses the data-backcolor to set the highlight color. I then used JS to set that value whenever the page loads.
But it would still be nicer (or more elegant, I think) to do it using an option on Summernote itself. I'll leave this question open for a day or two in case anyone knows how to do it using Summernote itself, before posting my JS solution.
Summernote themes might be what I'm looking for, but I'll have to look into it further to make sure. Thanks #razvans
Update 2:
I apologize to everyone that viewed this question, but I had worded it badly :(.
I was referring to the color used to highlight text in summernote (which summernote refers to as the background color of the text) - I wasn't referring to the color of the editor itself.
Again, sorry about that. :(
I dug into the page source and found that Summernote stores the highlighting color in the data-backcolor attribute. It also marks the highlighting button element with data-original-title="Recent Color". So, I used those to change the default color with JS:
First, I selected the button and changed the color it would highlight text with. I also changed the background of the button itself to better reflect what the color would be:
$('[data-original-title="Recent Color"]').each ->
$(this).attr "data-backcolor", "#F7C6CE"
$(this).attr "style", "background-color: rgb(247, 198, 206);"
Then, I also changed the background of the icon within the button, so that it blended into the button (instead of being a white square within the button):
$('i.note-recent-color').each ->
$(this).attr "style", "background-color: rgb(247, 198, 206);"
Finally, I removed the option to select new highlighting colors, since that wasn't needed in my application and would only serve to confuse the person using it. The button for selecting new colors was given the data-original-title="More Color" attribute:
$('[data-original-title="More Color"]').each ->
$(this).attr "style", "display: none;"
2022: I had almost the same problem. I needed to set background color to 'transparent' always, and limit the number of text foreground colors. Also disable the option to select other colors. Basically, I just wanted the users to choose between 4 text colors only, all with transparent background. So I chopped away the code from summernote.js (summernote-lit.js line 9837):
// pallete colors(n x n)
colors: [['#FFFF00', '#FF0000', '#00FF00', '#0000FF']],
// http://chir.ag/projects/name-that-color/
colorsName: [['Yellow', 'Red', 'Green', 'Blue']],
colorButton: {
foreColor: '#000000',
backColor: '#transparent'
}
I also changed the popover (summernote-lite.js line 7429) to:
items: (foreColor ? ['<div class="note-palette">', '<div class="note-palette-title">'
+ this.lang.color.foreground + '</div>', '<div>', '</div>', '<div
class="note-holder" data-event="foreColor"><!-- fore colors --></div>',
'<div>', '', '', '</div>', // Fix missing Div, Commented to find easily if it's wrong
'', '</div>'].join('') : ''),
And the result is:
I know this is not an elegant solution since I'm just hacking and hardcoding stuff, but it served my purpose.

Change class property without forcing it to stay that way

I've been trying to change the background color of these buttons on stackoverflow:
If I edit the background property in Firefox's inspector, everything functions as expected:
However, once I run a greasemonkey script to change it, I run into issues. It's like my script permanently froze the background of the button:
var tags = document.getElementById("nav-tags");
tags.style.background = "#1D3239 none repeat scroll 0% 0%"
Every stackexchange post I've looked over and every article I've found through Google search says that the way to change the property of a CSS class is to set it through object.style, but since I'm experiencing this behavior of the background freezing and never changing along with only the tag button changing and none of the others, it leads me to believe that setting the background of the style is really just changing (and freezing) the background of the element and not the class.
How can I change the background of the class (not just that one element) and not have it permanently freeze the change (I want the orange highlight to still happen)? Even if the buttons had classes, the only way I know to access them is through document.getElementsByClassName() which would return elements and not the class. I don't know how to edit the class directly through JavaScript.
Also, on the topic of the orange highlight, I don't see a property for it anywhere in the Firefox inspector window. Where can I find it so that I know what to modify?
Label the buttons with the same class, say "orangeToBlack", then use CSS:
.orangeToBlack {
background-color: orange;
}
.orangeToBlack:hover {
background-color: black;
}

How do you change the background color of an html table entry background when something specific happens?

I'm making an html table and I need the background of certain boxes to change color that after a selenium webdriver runs. For example if the webdriver runs through the site with no errors it would change the box in the table for that app green or if there were errors change the box color to red. I know I would need java script for this but I have never used it before.
You can use the JavaScript property document.body.style.background.
Here is an example :
function changeBackground(color) {
document.body.style.background = color;
}
Check here for more information : How do I change the background color with JavaScript?
To change the background color of an box when the user press enter key for instance, click : Changing background color of text box input not working when empty.
Indeed, you will need to adapt with your own element.

Changing a transparent images background color after clicking on a seperate div

I am trying to add a background color selection to an E-Card site I am making for an assignment in college.
I have the button and the background set up, but cant seem to get the JS for it to work.
I am a newbie with javascript/jquery, so I'm aware I am probably making a ridiculous mistake, but my code so far is:
$(".pink").on("click", function() {
$(".card-preview img").css("background-color", "red");
});
Where ".pink" is the button you would press to the the background color of an image inside the "card-preview" div.
This way seems relatively simple, but doesn't seem to be working!
Any ideas/suggestions?
The .pink div has a dual class on it, the second class is ".box", which sets the size as there are a few intended color selections available.
The page in question is linked here: http://www.remotegoatdesign.com/sayhey/pages/edit-valentines-marc-card.html
Rewrite your code to:
$(function() {
$(".pink").on("click", function() {
$(".card-preview img").css("background-color", "red");
});
});
or place on bottom of page, berofe </body>
This makes your code run only after the DOM is loaded.
.card-preview img: you are changing the background colour of the img elements inside the div, not the div itself.
try using .click() it worked fine for me. check my fiddle
edit
noticed your selection divs for colors show class='box pink' i changed my fiddle to match.
edit
for the comment below: fiddle

Categories