Solved

css style not changing. why?

Posted on 2014-04-01
1
398 Views
Last Modified: 2014-04-21
Hi;

I have the following css.

.aui-header .aui-nav .aui-buttons .aui-button-primary,
.aui-header .aui-nav .aui-buttons .aui-button-primary:link,
.aui-header .aui-nav .aui-buttons .aui-button-primary:visited {
    background: #336ea9;
    background-image: -moz-linear-gradient(top, #3b7fc4, #336ea9);
    background-image: -ms-linear-gradient(top,  #3b7fc4, #336ea9);
    background-image: -webkit-linear-gradient(top,  #3b7fc4, #336ea9);
    background-image: -o-linear-gradient(top,  #3b7fc4, #336ea9);
    background-image: linear-gradient(top,  #3b7fc4, #336ea9);
    height: 28px;
    border: 0;
    box-shadow: rgba(255, 255, 255, 0.1) 0 1px 0 0 inset, rgba(0, 0, 0, 0.2) 0 1px 1px 0;
    color: #fff;    
    text-shadow: 0 1px 0 #295989;
}

Open in new window


and following jquery

$('.aui-buttons').css({ 'background-color': '#FF6633', 'background-image': '-webkit-gradient(linear, left top, left bottom, from(#FF6633), to(#FF6633))',
'background-image': '-webkit-linear-gradient(top, #FF6633, #FF6633)',
'background-image': '-moz-linear-gradient(top, #FF6633, #FF6633)',
'background-image': '-ms-linear-gradient(top, #FF6633, #FF6633)',
'background-image': '-o-linear-gradient(top, #4ba614, #FF6633)',
'background-image': 'linear-gradient(to bottom, #FF6633, #FF6633)',
'background-color': '#FF6633',
'background': '#FF6633'
});

Open in new window


and background doesn't become from:
'background': '#336ea9'
to:
'background': '#FF6633'

Why?

Regards.
0
Comment
Question by:jazzIIIlove
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 39969719
It's because your CSS is styling the .aui-button-primary element and your jQuery is applying the style to it's parent (.aui-buttons). You need to apply the jQuery CSS to the same child:

$('.aui-buttons .aui-button-primary').css({
   ...
}

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
This article discusses how to implement server side field validation and display customized error messages to the client.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question