Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

create hover effect for div

Posted on 2011-09-09
3
Medium Priority
?
494 Views
Last Modified: 2012-05-12
   $(document).ready(function ()
    {
        $('div[class*="catnav"]').css("border", "1px solid blue");        
    });

I want to take this collection and apply a hover effect for the divs...on hover do THIS...on "normal" do THIS....
0
Comment
Question by:Tom Knowlton
[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
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 36513027
$(document).ready(function ()
    {
        $('div[class*="catnav"]').hover(
            function() { // on hover do THIS
               $(this).css("border", "1px solid blue");        
            },
            function() { // on "normal" do THIS
               $(this).css("border", "5px solid red");        
            }
        )          
            
    });

Open in new window


more info here : http://api.jquery.com/hover/
0
 
LVL 82

Expert Comment

by:leakim971
ID: 36513036
0
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 36513175
Thank you!

[my notes for later]

    $(document).ready(function ()
    {
        $('div[class*="catnav"]').hover(

            function ()
            {
                //$(this).stop().animate({ opacity: 1 }, 1000);
                $(this).css("background-color", "#eeeeee");
            },
            function ()
            {
                $(this).css("background-color", "#fafafa");
            }
            );
    });

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

636 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