Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorgujjar
    • CommentTimeFeb 6th 2009
     permalink
    Hello,

    guys i want to creat a kind of menu for e.g ... i have this list in my menu div


    <body>
    <div id="menu">
    <a href="#">users <br /></a>
    <a href="#">product <br /></a>
    <a href="#">movies <br /></a>
    <a href="#">clips <br /></a>
    <a href="#">teaser <br /></a>
    <a href="#">trailer <br /></a>
    <a href="#">HD Movie <br /></a>
    </div>
    </body>


    want I want is when I click the users link i want the users name to be displayed and all the other links here should disappear.. in the same div... is it possible in css
    can any one suggest is there any ajax, jquery or javascript solution is avaliable..


    Thanks
    • CommentAuthorajenny
    • CommentTimeFeb 10th 2009 edited
     permalink
    Better use <ul> for navigations like this. Not only does google like it more, its just good practise.

    And u can use jQuery to bind an action to '#users' that hides or fadesout the items u dont like manually.
    Like:
    $("#users").bind("click", function(e)
    {
    $('#item2').fadeOut();
    }

    Automated solutions are better but a bit more complex to build, read up on the jQuery api if you wanna try that.
    Have fun, jQuery rocks! :)
    • CommentAuthorgujjar
    • CommentTimeFeb 12th 2009
     permalink
    Thanks that really helped.. jQuery will work fine ;)
    • CommentAuthorgujjar
    • CommentTimeFeb 17th 2009
     permalink
    HI;

    ajenny!! this code worked for me, but i have a question that my menu div is having many links and each link has its own sublist , this is what i am using..

    $(document).ready(function(){
    $(".users").bind("click", function(){
    $('#menu').fadeOut();
    $('#sub_menu').fadeIn();
    })

    so here this is only for users link to show its sublist , and if i want to do the same with product link i have to copy and paste the function.. I think that will make a mess.. so can you or anyone here can give me a example of function so i dont have to copy paste.....


    Thanks ;)
Add your comments
    Username Password
  • Format comments as (Help)