0

I'm currently using bootstrap 4 and been looking for answers but I can't seem to find it. My scripts are not working, specifically, the smooth scroll script. I used the live links for the bootstraps and jquery because even the offline files won't work.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/style.css"/>


</head>

<body>

    <header>
      <!-- Fixed navbar -->
      <nav class="navbar navbar-expand-md  navbar-light fixed-top">
        <a class="navbar-brand" href="#home"> <img src="images/logo_final.ico" width="50" height="50" class="d-inline-block" alt="">Importante Ka Ba?</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarCollapse">
          <ul class="navbar-nav ml-auto">
            <li class="nav-item">
              <a class="nav-link" href="#home">Home</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#parentstyle">Parenting Styles</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="#stories">Stories</a>
            </li>
          </ul>

        </div>
      </nav>
    </header>


<div id="home">

<div class="container-fluid">

    <div class="row">
        <div class="left col-sm-6"></div>
        <div class="right col-sm-6">
        <h1> Game
         ka na ba makita ang teenage angst ng panahong ito?
        <hr style="background-color: red;">
        <a class="btn" href="#parentstyle" type="button"  >Game na!</a>
        </h1>
</div>
</div>
</div>
</div>




<div id="parentstyle">

<div class="container-fluid">
<h1> adfa </h1>
</div>
</div>




<div id="stories">

<div class="container-fluid">
<h1> adfa </h1>
</div>
</div>



<div id="articles">

<div class="container-fluid">
<h1> adfa </h1>
</div>
</div>


 <footer class="footer">
      <div class="container">
        <span class="text-muted">Place sticky footer content here.</span>
      </div>
    </footer>


<!--script-->


<script>
$("html").easeScroll();
</script>

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="js/jquery.easeScroll.js"></script>




</body>

below is the css that I used in case that it might be conflicting with the codes.

@charset "utf-8";
/* CSS Document */


@font-face {
    font-family: over;
    src: url("../fonts/over.ttf");
}

@font-face {
    font-family: coco;
    src: url("../fonts/coco.ttf");
}


* { 
margin: 0;
}

.navbar {
      background:transparent;
  background-image:none;
  border-color:transparent;
  box-shadow:none;
}

.navbar-brand {
    font-family: arial;
    font-weight: bold;
}

.left {
    height: 100vh;
    float: left;
    background-image: url(../images/homebg2.jpg);
    background-size:cover;
}

.right {
    height: 100vh;
    float: right;
    background-image: url(../images/homebg.jpg);
    background-size:cover;
}

.right h1 {
    text-align: center;
   position: absolute;
    top: 50%;
    left: 50%;
    -ms-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    font-family: coco;
    font-size: 1.5rem;
    color: white;
}

#home .btn {
    background-color: #ffce2d;
    font-family: over;
    font-size: 2rem;
    color: black;
} 


#stories {
    height: 100vh;
    background-image: url("http://hdqwalls.com/wallpapers/city-minimalism-sv.jpg");
    padding-top: 60px;
        background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;

}


#parentstyle {
    padding-top: 60px;
    height: 100vh;
    background-image: url("https://i.pinimg.com/originals/2b/19/fb/2b19fb4193506a0d5119beace69d7551.png" );
        background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}


#articles {
    padding-top: 60px;
    height: 100vh;
    background-color: gray;
        background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

@media only screen and (max-width: 950px) {
    .left, .right {
        float: none !important;
    }

    .right {
        background-image: none !important;
        background-color: #f6d6c1;
    }

    .right h1{
        color: #170C60 !important;
    }

    .navbar {
        background-color: white;
    }

}

1 Answer 1

1

You need to change some rules.

Swap:

<script>
$("html").easeScroll();
</script>

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

With:

<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="js/jquery.easeScroll.js"></script>

<script>
$("html").easeScroll();
</script>

You are trying to use easeScroll before it has loaded/ initialized.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.