Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9019417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:46:21+00:00 2026-06-16T04:46:21+00:00

my problem is in my website,when I load the page and click Home,if article

  • 0

my problem is in my website,when I load the page and click Home,if article is visible on screen, the js I’ve written hides it smoothly and great with no problem.but when I click the About Us Link,it shows the article but with broken css position while its act is finished.

here is the code:

HTML:

<nav>
    <ul class="sf-menu sf-vertical">
        <li><a href=# onclick=home()>Home</a></li>
        <li><a href=#about onclick=about()>About Us</a></li>
        <li><a href=#>Cuisines</a>
            <ul>
                <li><a href=#starters>Starters</a></li>
                <li><a href=#>Main Dishes</a></li>
                <li><a href=#>Desserts</a></li>
                <li><a href=#>Mezes</a></li>
            </ul>
        </li>
        <li><a href=#>Wine List</a></li>
        <li><a href=#gallery>Gallery</a></li>
        <li><a href=#contacts>Contacts</a></li>
    </ul>
</nav>

<article class=vanished id=about>
    <h1>About Us</h1>
    <div class="main-wrapper scroll">
        <div class="wrapper clearfix">
            <img src=img/bazar-place.png alt=bazar-place width=222 height=150 class=about-img>
            <h4>Our Restaurant</h4>
            <p>Bazar is a restaurant located between the districts Haga and Vasastaden in Gothenburg with a focus on Turkish and Persian food of the best quality that creates opportunities for an exciting mix all the way, from appetizer to dessert.</p>
        </div>
        <div class="wrapper clearfix">
            <img src=img/belly.jpg alt=belly-dancing width=222 height=167 class=about-img id=belly>
            <h4>Events</h4>
            <p>Every Saturday from 21, we have Belly dancing at Bazar.</p>
        </div>
        <div class="wrapper clearfix">
            <img src=img/food.jpg alt=food-services width=222 height=167 class=about-img id=food>
            <h4>Food Services</h4>
            <p>Taste our famous pasta dish to the human price of 69 :- We offer 10% discount for take-away at our entire menu.</p>
            <p>At lunchtime you can choose from three Turkish pasta dishes or among two or three different main dishes. Ask about vegetarian options! Drinking, salad and coffee / tea included. Lunch can also be picked up.</p>
        </div>
        <div class="wrapper last clearfix">
            <img src=img/extra.jpg alt=extra-services width=222 height=167 class=about-img id=extra>
            <h4>Extra Services</h4>
            <p>We can help with everything from after work, kick-off to the birthday called with food and drink that lasts all night. Do you want more entertainment we can arrange live music and belly dancing.</p>
        </div>
    </div>
</article>

JAVASCRIPT:

function home(){

    if ($(".active") == [])
    {
        return ;
    }
    else
    {
        var active = $(".active");
        active.css("display","inline-block");
        active.hide("slide",{direction:"left"},700);
        active.attr("class","vanished");

    }
}
function about(){
    if ($(".active") == [])
    {
        var hidden = $("#about");
        hidden.css("display","inline-block");
        hidden.show("slide",{direction : "right"},700);
        hidden.attr("class","active");
    }
    else
    {
        if ($("#about").attr("class") == "active")
        {
            return ;
        }
        else
        {
            var active = $(".active");
            active.css("display","inline-block");
            active.hide("slide",{direction:"left"},700);
            active.attr("class","vanished");
            var hidden = $("#about");
            hidden.css("display","inline-block");
            hidden.show("slide",{direction : "right"},700);
            hidden.attr("class","active");
        }

    }
}

CSS:

article{
    position: absolute;
    width: 550px;
    height: 100%;
    background-image: url("../img/blockBG.png");
    z-index: 1;
    left: 235px;
    border-left: 1px solid #4A4A4A;
    border-right-color: #7b7b7b;
    border-right-style: solid;
    border-right-width: thick;
    padding-right: 40px;
    padding-left: 40px;
    text-align: center;

}

.vanished{
    display:none;
}

.main-wrapper{
    position:relative;
    z-index:1;
    width: 100%;
    height: 590px;
    display:block;
}

.wrapper{
    border-bottom:1px solid #4A4A4A;
    margin-bottom: 15px;
}

.last{
    border: none;
}

h4{
    color: #efefef;
    text-decoration: none;
    text-align: left;
    font-family:'Yeseva One',cursive;
    font-size: 17px;
    font-weight: normal;
    margin-bottom: 10px;
    margin-top: 0;
    line-height: 19px;
}

h1{
    position: relative;
    font-family:'Yeseva One',cursive;
    font-size:60px;
    z-index: 2;
    color: white;
    margin-top: 90px;
    padding-bottom: 41px;
    margin-bottom: 20px;
    font-weight: normal;
    border-bottom:1px solid #4A4A4A;
}

p{
    color: #efefef;
    text-decoration: none;
    text-align: left;
    font-family:Arial, sans-serif;
    font-size: 12px;

}

.clearfix:before,
.clearfix:after {
    content: " "; /* 1 */
    display: table; /* 2 */
}

.clearfix:after {
    clear: both;
}

/*
 * For IE 6/7 only
 * Include this rule to trigger hasLayout and contain floats.
 */

.clearfix {
    *zoom: 1;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:46:22+00:00Added an answer on June 16, 2026 at 4:46 am

    The problem is with the <h1> margin-top only being correctly applied at the end of the animation.

    Try turning the distance top into a padding instead of margin, it should fix it:

    h1{
        position: relative;
        font-family:'Yeseva One',cursive;
        font-size:60px;
        z-index: 2;
        color: white;
        margin-top: 0;
        padding-top: 90px;
        padding-bottom: 41px;
        margin-bottom: 20px;
        font-weight: normal;
        border-bottom:1px solid #4A4A4A;
    }
    

    Alternatively, you could give the parent <article> a padding or border top. This will prevent the <h1> margin from collapsing outside it’s container while the animation runs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an iframe in my page where I load content of the website
I'm just about finished writing a backend for a website in PHP/MySQL/jQuery, but my
my problem is a plugin called Sexy Alert Box when I load the page,
I got a problem with a script, when I try to load the page
On my mobile website. I've been trying to load Adsense Mobile ads, but they
I'm having a problem concerning my website not running the code behind an ItemCommand
I'm using masonry plugin in my website My problem is that the first 20
Problem I have some pages that need dynamic data from website to generate output
My problem is everytime i open the website; first time the map doesn't show
I'm having a problem with a PHP website running on IIS 7 on Windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.