Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    2
    Member #
    30109
    Hi, I'm trying to get menu's on my webpage to open smoothly such as on this example I found:

    http://www.kingston.ac.uk/undergradu...12/#modulelist

    Click the module links to see what I mean.

    Currently mine just appear instantly

    http://taxisareblack.co.uk/

    Could I get help with achieving a smoother opening transition? I wrote the page in Notepad HTML and used Javascript - Lightbox for the images. I hope someone can help! Thanks.

  2.  

  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Gonna be jQuery for that one. I did something similar on the portfolio page of my site.
    Code:
    $(document).ready(function(){
        $('.class').toggle(function() {
                $(this).parent('.parent').animate({height: "550"}, "slow");
            }, function() {
                $(this).parent('.parent').animate({height: "60"}, "slow");
    });
    This script will basically expand the parent div (or whatever element) when an internal element, such as an h3 tag is clicked.

    Change '.class' to whatever the class or selector of the clicked element is. Change '.parent' to the class or selector of the parent element. Change the first height number to what you want it to expand to, and the second number to whatever the initial height is in the CSS.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  4. #3
    Junior Member
    Join Date
    Dec 2011
    Posts
    2
    Member #
    30109
    Thanks for the reply, I input the script into the rest of it but I'm not really sure what to change '.class' or .'parent' to..

    HTML Code:
    <script>
    $(document).ready(function(){
        $('Slidemenu').toggle(function() {
                $(this).parent('.parent').animate({height: "550"}, "slow");
            }, function() {
                $(this).parent('.parent').animate({height: "60"}, "slow");
    });
    </script>
    
    </head>
    
    <body onload="hide();">
    <a onclick="switchMenu('toggle');" title="Taxisareblack" CLASS="Slidemenu"><img src="images/banner2.gif"></a><br><div id="toggle">
    
    <a onclick="switchMenu('experiments');"><i>Experiments</i></a>
    <div id="experiments">
    
    <a onclick="switchMenu('recent');"><i>- Recent</i></a>
    In that case what would '.parent' inside the brackets change to?

    Also, where ought I save the Jquery file to? (First time using it, I'm a tad confused!)


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:23 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com