how to create css background effect in extjs4.0 application(on selection) - css

i am creating a application on extjs4
i wanted to attain the css selection mouse hover property on the textfields and combo box,the effect where.. background color can change on overcls in extjs
please help if you can't understand my question i will post it again!
Thanks

Here is how to do it:
On your field config add your custom css class like this: fieldCls: 'required'
Create your custom CSS class like this:
.required:hover {
background-image:none;
background-color:#FFFFCC;
}
Include your custom css file on the page

Related

Javafx Hyperlink: Style to influence visibility of 'underline' of link

I want that the 'underline' of a hyperlink in JavaFx is always visible. How can I achieve this ?
You can achieve this using css like this
link.setStyle("-fx-underline: true");
Or you could create a css file if you want to style your link more

Override twitter-bootstrap css

I'm using a button with bootstrap, something like:
I want to disable the style change when the button is hovered or click. I figured I could do this by overriding btn-default:focus or btn:focus but I also have other <a> tags styled as buttons that I would like to keep the effects of click or focus. Is there a way that I could just override the standard bootstrap css in just this case?
add an id to this particular
then add this css
#overrideBS:focus {
//whatever unique properties you want
}
Add your own class myclass, then set myclass:focus with whatever changes your need adding !important at the end of the overridden value.

GWT - Changing CSS hover property

I'm a new user of GWT and I'm looking for some advice concerning "theme management".
I have to make a website that can handle theme changes. What I mean is that a user can make is own theme by filling a form, then the website will automatically and dynamically changes its color to display the new ones.
I thought using a CSS sheet for all the static properties and using some GWT lines (e.g. label.getElement.getStyle.setColor(...)) to change color. But I have many "hover" properties and I think creating many MouseOverHandler is not a good idea ...
Is there a way to edit CSS sheet dynamically or a magic trick to do that ?
Thanks.
You have many options - the most straight forward (to me) is to make use of the existing CSS classes that GWT introduces. If you look at javadocs for any of the widgets GWT provides, you'll notice the CSS Style Rules section. For example, Button:
.gwt-Button
the outer element
That means that every Button you add to the page has a .gwt-Button style applied to it. If you inject a CSS stylesheet with a rule that overrides this style:
.gwtButton {
background: red;
}
All your buttons will turn red. You can inject stylesheets using StyleInjector. Creating the stylesheet's content dynamically is up to you - but it's just text, it shouldn't be hard (but make sure the generated CSS rules are valid!).
To get you started, try hooking up this code to some button and see if clicking it triggers changing all the Buttons on the page red:
StyleInjector.inject(".gwt-Button { background: red; }");
If you have custom widgets that you want styled differently, just add an individual class to them (.customWidgetWhatever, like Button has .gwt-Button, etc.) that you will include in your custom stylesheet.
Make sure you understand how CSS works and what it can do for you. For example, if you want to style each button the same, you don't have to change each button's style individually, just use:
button {
background: green;
}
And all the <button>s will turn green.
The easiest way to change themes without reloading the whole application is to assign a theme class to the body element.
You'd want to prepend each CSS class in your app with a particular theme, e.g.:
.theme1 .myClass {
color: red;
}
.theme2 .myClass {
color: blue;
}
Then you'll apply a particular theme to the body element:
<body class="theme1">
When you want to change themes, you'll have to change the body class so it will become:
<body class="theme2">
this way, each element that has class myClass will have its color changed from red to blue.
You cannot edit a CSS file dynamically, but you can inject CSS style either as a new CSS file, or directly into your document.
For example, you can define all key CSS rules in your "main.css" file, and add your user-defined rules directly into the host HTML page with a style tag.

Add custom css class to WordPress Gallery

I would like to add a custom css class to the native WordPress gallery. For example, this one outputs the following HTML:
<div id="gallery-2" class="gallery galleryid-1715 gallery-columns-4 gallery-size-thumbnail">
I'd like to just add in a custom class of iwmp.
What's the best way of doing this? I was hoping for a non JS solution. Thanks
EDIT: Answered my question below.
This link solved my problem: http://www.sk23.co.uk/wordpress/how-to-override-the-default-wordpress-gallery-embedded-css-styles-in-wp/
You have to remove the default gallery shortcode, and create your own. What I did was copy n paste it, and add in the new class.
Thanks
You should just be able to put your custom class in the list of classes and then, in your css file, describe the properties associated with that class.
For example:
Your html would be
<div id="gallery-2" class="iwmp gallery galleryid-1715 gallery-columns-4 gallery-size-thumbnail">
And then let's say you wanted everything in class iwmp to have a red background color and have center alignment you would add the following to your css file:
CSS addition:
.iwmp {
background: #ff0000;
text-align: center;
}

change css class properties in extjs

I wanted to change the styles of calendar panel using extjs.I am using extjs calendarpanel and datepicker in my EHR application like following link
http://dev.sencha.com/deploy/ext-3.4.0/examples/calendar/index.html
when selecting a date from datepicker if the day is a public holiday,(that is get from database on select event )i want to change the background color of calendarpanel to gray color.Is it possible?is any way to change the css class properties using extjs3.3.
you can override the extjs css with the using cls property for the particular element.Here is
i am using own css class for the text.
{
text:'Create App',
cls:'app42CreateApp',
},
You can assign a custom class to the cell you need, for example here is how it works with the 15. day of month:
Ext.get(Ext.get('mydatepicker').query('td.x-datepicker-active[title*="15,"]')[0].id).addCls("mynewclass")
You can take a look to that Extjs 2/3 plugin

Resources