I have a textbox with some css property created by formHandler method.
When I check the textbox is empty and I applied another css class for red color in the border through jquery code is below
$('a,button').click(function () {
if($("#FHE_0_first_name").val()=="")
{
$("#FHE_0_first_name").addClass("errorCSS");
}
});
and my css is below
.errorCSS
{
clear:both;
border:1px solid #ff0000 !important;
background-color:#ffeeee !important;
}
The red color and background color just come and disappered how can i keep the neww css .
appreciated all suggestions
First you'll need to change your $(a,button) selector to $(a.button).
Related
I am trying to set the background color to transparent for this page:
.page-id-714 .container-fluid {
background-color: transparent;
}
But I do not seem to be able to address the correct class or item. Can anyone point me in the right direction?
You are setting it on the wrong class. You need to set it on
.top-stripe {
/* Current, it's set to background-color: #fbfbfb; */
background-color: transparent;
}
Make sure you declare the above after the selector which I've shared below, else you need to make your selector more specific, or you need to use !important which I would not recommend, or better, you remove top-stripe from that declaration altogether.
Here's the declaration on your webpage..
Try this:
.top-stripe {
background-color: transparent!important;
}
Hi I have this current CSS for fullCalendar (v 1.6.4):
.full-calendar .fc-content .fc-event-container .fc-event {
background: #ef6262!important;
border-color: #eb3d3d!important;
color: #fff!important;
border-radius: 0;
}
When I add a new Class to an event (based on some programming calculations) I do this:
event.className = 'paused-event';
calendar.fullCalendar('updateEvent', event);
My paused-event CSS is this:
.paused-event,
.paused-event div,
.paused-event span {
background: #71CCBF;
border-color: #65B7AB;
}
The background color changes correctly, the border stays the same as the default CSS.
Expectancy:
The event color AND border should change when the paused-event class is present.
The !importants are overriding the latest class properties. You could try to add !important to .paused-event properties as well, but the best would be to avoid any !importants and simply override by impacting with a deeper selector (although it's weird the background does change considering the important):
.class1 vs div.class1.class2 (deeper one)
Anyways, if you simply need to solve that and fast you can try:
.paused-event,
.paused-event div,
.paused-event span {
background: #71CCBF;
border-color: #65B7AB !important;
}
I am using headroom.js to hide my header when scrolling down and make my header section visible again when scrolling up. The header section contains my logo and navigation buttons.
While at the top of my page I need my navigation buttons to be a darker color because my background color is a lighter, and when scrolling down i need my navigation buttons to be a lighter color because the header background color is darker.
I have created colors classes in CSS to change the button colors.
CSS:
.topColor {color: red;}
.scrollColor {color: white;}
I'm using angularjs for this project, so i'm using headroom.js angular module and the option below.
angular:
<headroom id="header" tolerance="5" offset="205" classes='{"initial":"animated","pinned":"swingInX","unpinned":"swingOutX","top":"headroom--top","notTop":"headroom--not-top"}' >
In an attempt to accomplish the task of changing my navigation buttons, I tried two different approaches.
1.) Created a directive to check if headroom hasClas('headroom--not-top') and if it did add class ('.scrollColor') to my navigation buttons ('#navColor') otherwise add class ('.topColor').
.directive('headroom', function(){
return{
restrict:'E',
link: function(scope, element, attrs){
if($(element).hasClass('headroom--not-top'))
{
$('#navColor').addClass('.scrollColor');
}else{
$('#navColor').addClass('.topColor');
}
}
}
});
2.) I then tried this approach...
.directive('headroom', function(){
return{
restrict:'E',
link: function(scope, element, attrs){
if($(element).hasClass('headroom--not-top'))
{
$scope.myNavColor = "scrollColor";
}else{
$scope.myNavColor = "topColor";
}
}
}
});
nav in html
<li><a id="navColor" ng-class="{current: isCurrentPath('/')}" active class = "{{myNavColor}}" ng-href="#/">Home</a></li>
Neither attempt worked for me, however the first attempt did change the button white, but when i scrolled down it did not change. I believe the problem is $(element) is not being recognized, or am I just approaching this task completely wrong?
I found a solution for this "issue" using CSS! headroom.js uses two classes to detect when the header is at top the page and when it's scrolling (not a the top), so I provided the following CSS.
header.headroom--not-top ul li a{
color: red;
}
header.headroom--top ul li a{
color: white;
}
In my case (using nav class from bootstrap):
nav.headroom--not-top { color: red; background-color: lightgrey; opacity: .8 }
nav.headroom--top { color: white }
It work, but the ideal situation would be that the color was a complementary color from the background color when the nabber descend.. Isn't?. Maybe in jQuery...
I want to override .btn (and btn-success, btn-info, etc, etc) so that ALL of the background gradient is gone (keep the shadow).
.btn{
//what goes here to remove the background gradient?
//must work with the other colors
}
This should do it for you.
.btn {
background-image:none;
}
How to give custom style to dojo ValidationTextBox?
We need to override the default css applied to dojo ValidationTextBox. Currently when the field is required, it shows some yellow background and a exclamation mark around the textbox.
See below
Or is it possible to remove the yellow background and the exclamation mark and just keep the tooltip error message?
.tundra .dijitSelectError .dijitButtonContents,
.tundra .dijitTextBoxError,
.tundra .dijitTextBoxError .dijitButtonNode {
border-color: #d46464;
}
.tundra .dijitError {
background-color: #d46464;
}
.tundra .dijitValidationTextBoxError .dijitValidationIcon {
background: url('http://cdn.sstatic.net/stackoverflow/img/sprites.png?v=5') no-repeat -55px -66px;
}
http://jsfiddle.net/cswing/Yytzj/