user2045025
user2045025

Reputation:

hover property for text not working

On mouse hover of the text CRM a pop up opens up. When I mouse hover the text the text color should change – the color of the text should become red on hover.

I've provided my code below.

I gave the hover property to my class but it's not working. How do I fix it?

http://jsfiddle.net/a5tjG/3/embedded/result/

.cubeTextStyleCRM:hover {
    color: red;
}
$('document').ready(function() {
                window.setTimeout(function() {
                    $('.cubeCellCRM').each(function() {
                        var htmlText = $(this).attr('data-text');
                        $(this).append('<div class="cubeTextStyleCRM">' + htmlText + '</div>');

                        $(this).hover(

                        function() {
                            $(".cubeTextStyleCRM").append("<span class='divStock'>Customer Relationship Management</span>");

                        },

                        function() {
                            $(this).find("span:last").remove();
                        });
                    });
                }, 600);

            });

<div class="cubeCellCRM" data-text="CRM" data-caption="
                                &lt;a style='padding-left: 40px; font-size: 14px; color: grey;' href='#' &gt;Create&lt;/a&gt; &lt;div&gt; 
                                &lt;a style='padding-left: 40px; font-size: 14px; color: grey;' href='#' &gt;View/Edit&lt;/a&gt; &lt;/div&gt; 
                                &lt;a style='padding-left: 40px; font-size: 14px; color: grey;' href='#' &gt;Reports&lt;/a&gt;"
                        data-image="http://intra.defie.co/images/Desktop_icons_02.07.13/CRM.png"></div>
                    </div>

Upvotes: 1

Views: 232

Answers (1)

eburgos
eburgos

Reputation: 2053

Your .cubeTextStyleCRM in your CSS has a color: #333 !important; that is overriding your color. Just leave it like color: #333; and your :hover should work. If for some reason you can't reach that part of the CSS just rewrite that rule again like:

<style>
.cubeTextStyleCRM {
  color: #333;
}
.cubeTextStyleCRM:hover {
  color: red;
}
</style>

Upvotes: 1

Related Questions