Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS selector issues

I am very bad with selectors, I am trying to figure out how to make a transition happen on my form when I hover over the "create one" link. Can anyone help me?

http://jsfiddle.net/LyZxG/

body:hover .form{}

the fiddle above shows all of my code, I currently have it transitioning from "body:hover" so you can see the transition.

Thanks in advance!

ps. I have ready every form about selectors and cant figure it out, I know its simple I'm just not getting it, thank you again.

like image 233
user2793657 Avatar asked Nov 29 '25 21:11

user2793657


2 Answers

OK with just css all you need to do is remove the

body:hover .form{}

add and in

.create-link:hover .form{
opacity:1.0;
    width:260px;
}

After you do that you will need to update your create link html to this

<li class="create-link">
    <a href="#">
    <h1 class="account-links">Create One</h1></a>
    <form class="form" action="demo_form.asp" method="get">
        First name: <input type="text" name="fname"><br>
        Last name: <input type="text" name="lname"><br>
        Password: <input type="text" name="pass">
        <input type="submit" value="Submit">
    </form>
</li>
like image 187
mrdeleon Avatar answered Dec 07 '25 16:12

mrdeleon


Is this what you're looking for?

http://jsfiddle.net/HM82L/

jquery code

$(".create-link").hover(function(){
    $(".form").addClass("form-hover");
}, function(){
    $(".form").removeClass("form-hover");
});

and a little bit of CSS

.form{height:100px; transition:all .5s;}

.form-hover{
    height:300px;
}
like image 34
Mixin Avatar answered Dec 07 '25 15:12

Mixin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!