单击导航栏时滚动到页面的一部分 [英] Scroll to a section of the page when clicking on the navbar

查看:65
本文介绍了单击导航栏时滚动到页面的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在制作我的第一个网站 - 一个单页网站,其中包含包含内容的不同部分.我创建了一个漂亮的导航栏,并一直在网上搜索以尝试找到一种方法来为其添加功能.

这是导航栏的标记:

<img src="images/shield.svg"></a><ul class="菜单"><li><a href="#home">首页</a></li><li><a href="#about">关于</a></li><li><a href="#myskills">我的技能</a></li><li><a href="#mywork">我的作品</a></li><li class="border"><a href="#">联系我</a></li>

  • <a href="#" class="dropdown-toggle">更多<b class="caret"></b></a><ul class="下拉菜单"><li><a href="#exploration">探索</a></li><li><a href="#music">音乐</a></li>
  • );

    提前致谢.

    我在 github 上查看了您的页面,并在您的内容中添加了 ID.例如,如果您这样做:那么您将转到 id="id" 的容器.

    例如我添加的页面:

    <li><a href="#myskills">我的技能</a></li>

    使用 HTML

    这是完整的 HTML.

    //更多菜单下拉切换功能var main = 函数(){$('.dropdown-toggle').click(function() {$('.下拉菜单').toggle();});//下一个箭头功能$('.arrow-next').click(function() {var currentSlide = $('.active-slide');var nextSlide = currentSlide.next();var currentDot = $('.active-dot');var nextDot = currentDot.next();如果(nextSlide.length == 0){nextSlide = $('.slide').first();nextDot = $('.dot').first();}currentSlide.fadeOut(600).removeClass('active-slide');nextSlide.fadeIn(600).addClass('active-slide');currentDot.removeClass('active-dot');nextDot.addClass('active-dot');});//上一个箭头点击功能$('.arrow-prev').click(function() {var currentSlide = $('.active-slide');var prevSlide = currentSlide.prev();var currentDot = $('.active-dot');var prevDot = currentDot.prev();如果(prevSlide.length == 0){prevSlide = $('.slide').last();prevDot = $('.dot').last();}currentSlide.fadeOut(600).removeClass('active-slide');prevSlide.fadeIn(600).addClass('active-slide');currentDot.removeClass('active-dot');prevDot.addClass('active-dot');});};$(document).ready(main);

    /* 一般 */.容器 {宽度:960px;}.下划线{边框底部:3px 实心 #7FCCE5;}.underlinegrey {边框底部:3px 实心 #808080;}.underlineblack {边框底部:3px 实心 #313131;}.underlinethin {边框底部:1px 实心 #7FCCE5;}.circle-icon {宽度:80px;高度:80px;文本对齐:居中;4 行高:80px;字体大小 2.1em;边框半径:40px;保证金:自动;颜色:#aaa;背景色:#ddd;}.glyphicon {位置:相对;显示:内联块;font-family: 'Glyphicons Halflings';字体样式:正常;字体粗细:400;字体大小:35px;}.circle-icon .glyphicon {顶部:0;行高:80px;文本对齐:居中;}/* 导航栏 */.nav {背景颜色:rgba(255, 255, 255, 0.95);边框底部:1px 实心 #ddd;字体系列:'Oswald',无衬线;字体粗细:300;字体大小:17px;填充:5px;位置:固定;顶部:0;左:0;z-索引:9999;宽度:100%;}.nav .title {位置:固定;左:100px;顶部:-10px;}.logo 图标 {位置:固定;左:500px;顶部:8px;}/* 菜单 */.nav .menu {浮动:对;列表样式:无;边距顶部:5px;}.menu >李{显示:内联;padding-left: 30px;padding-right: 30px;}.menu a {颜色:#898989;}.menu .border a {边框:1px 实心 #7FCCE5;填充:15px;填充顶部:2px;填充底部:2px;}/* 落下 */.下拉式菜单 {字体大小:16px;边距顶部:5px;最小宽度:105px;z-索引:999;}.dropdown-menu li a {颜色:#898989;填充:6px 20px;字体粗细:300;}/* 大屏幕 */.jumbotron {背景图片:url('http://p1.pichost.me/i/58/1822942.jpg');高度:1020px;背景重复:不重复;背景尺寸:封面;位置:初始;}.jumbotron .container {位置:相对;顶部:250px;}.jumbotron h1 {颜色:#fff;字体大小:80px;字体系列:'Oswald',无衬线;字体粗细:300;文本对齐:居中;填充:20px;文本阴影:0px 0px 3px #000;}.jumbotron p {颜色:#fff;字体大小:48px;字体系列:'Oswald',无衬线;字体粗细:300;文本对齐:居中;填充:20px;文本阴影:0px 0px 3px #000;}.jumbotron h3 {颜色:#fff;字体大小:80px;字体系列:'Oswald',无衬线;字体粗细:300;文本对齐:居中;填充:20px;文本阴影:0px 0px 3px #000;}.btn {显示:内联块;填充:4px 14px;底边距:0px;字体大小:13px;文本对齐:居中;垂直对齐:中间;光标:指针;边框半径:1px;边框颜色:#f7f6f6;行高:20px;字体粗细:粗体;颜色:#f7f6f6;背景色:透明;位置:相对;顶部:50px;左:340px;}.btn:悬停{背景图像:无;背景色:#808080;颜色:#f7f6f6;}/* 关于我 */.关于 {高度:600px;背景色:#ffffff;}.about .container {顶部:35px;位置:相对;}.关于 h3 {颜色:#313131;字体大小:40px;字体系列:'Oswald',无衬线;字体粗细:300;填充;20px;文本对齐:居中;}.关于 p {位置:相对;顶部:20px;颜色:#313131;字体大小:20px;字体系列:'Oswald',无衬线;字体粗细:300;填充:30px;行高:210%;}/* 我的技能  */.我的技能 {高度:880px;背景色:#F7F6F6;}.myskills .container {宽度:1500px;位置:相对;顶部:35px;}.myskills .row {位置:相对;文本对齐:居中;顶部:80px;填充底部:50px;}.myskills h3 {颜色:#808080;字体大小:40px;字体系列:'Oswald',无衬线;字体粗细:300;文本对齐:居中;}.myskills h1 {颜色:#808080;字体大小:25px;字体系列:'Oswald',无衬线;字体粗细:400;文本对齐:居中;填充底部:50px;}.myskills p {颜色:#808080;字体大小:20px;字体系列:'Oswald',无衬线;字体粗细:300;填充;20px;文本对齐:居中;行高:200%;}.glyphicon-心{红色;}.glyphicon-图片{颜色为橙色;}.glyphicon-云{白颜色;}.glyphicon 相机 {颜色:黑色;}.glyphicon-book {颜色:深紫色;}.glyphicon-音乐 {颜色:橙红色;}/* 我的工作 */.我的工作 {高度:400px;背景色:#FFFFFF;}.mywork .container {位置:相对;顶部:35px;}.mywork h3 {颜色:#313131;字体大小:40px;字体系列:'Oswald',无衬线;字体粗细:300;填充底部:40px;文本对齐:居中;}.mywork h1 {颜色:#313131;字体大小:30px;字体系列:'Oswald',无衬线;字体粗细:300;填充底部:20px;文本对齐:居中;}.mywork p {颜色:#313131;字体大小:20px;字体系列:'Oswald',无衬线;字体粗细:300;填充:50px;文本对齐:居中;}/* 接触 */.接触 {高度:330px;背景颜色:#313131;}.contact .container {位置:相对;顶部:35px;}.联系 .row {宽度:300px;位置:相对;左:325px;文本对齐:居中;顶部:30px;填充底部:40px;}.联系 h3 {颜色:#F7F6F6;字体大小:40px;字体系列:'Oswald',无衬线;字体粗细:300;填充;20px;文本对齐:居中;}.联系 h1 {颜色:#808080;字体大小:20px;字体系列:'Oswald',无衬线;字体粗细:300;填充:10px;文本对齐:居中;}. 联系 p {颜色:#F7F6F6;字体大小:16px;字体系列:'Oswald',无衬线;字体粗细:300;填充底部:15px;文本对齐:居中;}.联系{颜色:#7FCCE5;}/* 探索 */.探索{高度:1100px;背景色:#ffffff;}.探索 .container {位置:相对;顶部:35px;宽度:1200px;}.探索 h3 {颜色:#313131;字体大小:40px;字体系列:'Oswald',无衬线;字体粗细:300;填充底部:20px;文本对齐:居中;}.探索 p {颜色:#313131;字体大小:20px;字体系列:'Oswald',无衬线;字体粗细:300;文本对齐:居中;}.slider {位置:相对;顶部:50px;宽度:100%;高度:800px;}.滑动 {显示:无;位置:绝对;顶部:0;左:0;宽度:100%;高度:100%;}.active-slide {显示:块;}/* 滑动功能 */.slide-feature {文本对齐:居中;高度:800px;}.slide-feature-1 {背景图片:url('https://scontent-lhr.xx.fbcdn.net/hphotos-xaf1/t31.0-8/11036160_10152854777396270_5157414753497878003_o.jpg');背景位置:中心;}.slide-feature-2 {背景图片:url('https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xta1/t31.0-8/11218515_10152909922431270_7749144937209461633'jpg);背景位置:中心;}.slide-feature-3 {背景图片:url('https://scontent-lhr.xx.fbcdn.net/hphotos-xpa1/t31.0-8/11187795_10152891725491270_1769195601160147349_o.jpg');背景位置:底部;}.slide-feature-4 {背景图片:url('https://scontent-lhr.xx.fbcdn.net/hphotos-xaf1/t31.0-8/11154672_10152854784061270_3532862830070230799_o.jpg');背景位置:中心;}.slide-feature-5 {背景图片:url('https://scontent-lhr.xx.fbcdn.net/hphotos-xap1/t31.0-8/11164749_10152909922426270_8192461025609874418_o.jpg');背景位置:中心;}.slide-feature img {边距顶部:112px;底边距:28px;}.slider-nav {文本对齐:居中;边距顶部:20px;}.arrow-prev {右边距:45px;显示:内联块;垂直对齐:顶部;边距顶部:9px;位置:相对;顶部:40px;}.arrow-下一个{左边距:45px;显示:内联块;垂直对齐:顶部;边距顶部:9px;位置:相对;顶部:40px;}.slider-dots {列表样式:无;显示:内联块;填充左:0;底边距:0;位置:相对;顶部:40px;}.slider-dots li {颜色:#bbbcbc;显示:内联;字体大小:30px;右边距:5px;}.slider-dots li.active-dot {颜色:#7FCCE5;}/*音乐*/.音乐 {高度:1200px;背景颜色:#313131;}.music .container {位置:相对;顶部:35px;宽度:1500px;}.音乐 h3 {颜色:#F7F6F6;字体大小:40px;字体系列:'Oswald',无衬线;字体粗细:300;填充底部:;40 像素;文本对齐:居中;}.音乐 h1 {颜色:#808080;字体大小:20px;字体系列:'Oswald',无衬线;字体粗细:300;填充:30px;文本对齐:居中;}.音乐 p {颜色:#F7F6F6;字体大小:16px;字体系列:'Oswald',无衬线;字体粗细:300;填充-;文本对齐:居中;}iframe {位置:相对;顶部:10px;边距:20px;}/*页脚*/.页脚{高度:200px;背景色:#F7F6F6;}.页脚 h1 {颜色:#808080;字体大小:20px;字体系列:'Oswald',无衬线;字体粗细:300;文本对齐:居中;填充底部:50px;位置:相对;顶部:35px;}.页脚 p {颜色:#808080;字体大小:16px;字体系列:'Oswald',无衬线;字体粗细:300;填充;20px;文本对齐:居中;行高:200%;}

    <头><link href='http://fonts.googleapis.com/css?family=Oswald:400,300' rel='stylesheet'><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="样式表"><link href="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/style.css" rel="stylesheet"><script src="http://code.jquery.com/jquery-latest.js"></script><身体><!-- 导航栏--><div class="nav"><div class="容器"><div class="title"><h3>斯图尔特·埃霍夫</h3>

    <img src="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/images/shield.svg"></a><ul class="菜单"><li><a href="#">首页</a><li><a href="#about">关于</a><li><a href="#myskills">我的技能</a><li><a href="#mywork">我的作品</a><li class="border"><a href="#contactme">联系我</a>

  • <a href="#" class="dropdown-toggle">更多<b class="caret"></b></a><ul class="下拉菜单"><li><a href="#">探索</a>
  • <li><a href="#">音乐</a>

    <!--JUMBOTRON 从这里开始--><div class="jumbotron"><div class="容器"><h1>你好,世界.</h1><p>我的名字是<b>斯图尔特·埃霍夫</b>我是一名自学成才的网络开发人员.</p><h3>让我们一起工作.<button type="button" class="btn">告诉我更多</button><button type="button" class="btn">RESUME</button>

    <!--JUMBOTRON 到此结束--><!--关于从这里开始--><div class="about" id="about"><div class="容器"><h3><span class="underline">关于我</span></h3><p>我是一名自学成才的 Web 开发人员,住在英国莱斯特.我从小就一直在研究技术.</p><p>2014 年,我以音乐、技术和创新专业的一等荣誉毕业于德蒙福特大学.毕业后不久,我获得了一家专业音频解决方案公司的实习机会,并继续为公司工作例如华纳唱片和大西洋唱片.</p><p>本网站是我的劳动成果,希望大家喜欢.</p>

    <!--我的技能从这里开始--><div class="myskills" id="myskills"><div class="容器"><h3><span class="underlineblack">我的技能</span></h3><!--第 1 行--><div class="row"><div class="col-md-4"><div class="circle-icon"><span class="glyphicon glyphicon-heart"></span>

    <h1 class="underlinethin">自学</h1><p>我所知道的一切都是我自学的.我认为这显示了坚定的动力和奉献精神.</p>

    <div class="col-md-4"><div class="circle-icon"><span class="glyphicon glyphicon-picture"></span>

    <h1 class="underlinethin">前端开发</h1><p>能够使用 HTML、CSS 和 JavaScript 创建现代、设计精美的网站,使用起来感觉很棒.</p>

    <div class="col-md-4"><div class="circle-icon"><span class="glyphicon glyphicon-cloud"></span>

    <h1 class="underlinethin">框架和库</h1><p>对流行的前端(Bootstrap、jQuery)和后端(Ruby on Rails)框架和库充满信心.</p>

    <!--第 2 行--><div class="row"><div class="col-md-4"><div class="circle-icon"><span class="glyphicon glyphicon-camera"></span>

    <h1 class="underlinethin">摄影</h1><p>在 Adob​​e Photoshop 和 Lightroom 中拍摄、编辑和资产创建.</p>

    <div class="col-md-4"><div class="circle-icon"><span class="glyphicon glyphicon-book"></span>

    <h1 class="underlinethin">学习和解决问题</h1><p>不断为教育进步而努力,尝试新技术并提高技能.我将问题视为学习的挑战.</p>

    <div class="col-md-4"><div class="circle-icon"><span class="glyphicon glyphicon-music"></span>

    <h1 class="underlinethin">Audio</h1><p>在构建扬声器系统、录音、混音和母带制作方面接受过培训的音频工程师.</p>

    <!--我的工作从这里开始--><div class="mywork" id="mywork"><div class="容器"><h3><span class="underline">我的作品</span></h3><h1>即将到来<i>很快...</i></h1><p>我一直在寻找令人兴奋和创新的项目来开展工作.如果你想一起工作,那么请<a href="contact">联系我!</a></p>

    <!--联系方式从这里开始--><div class="contact" id="contactme"><div class="容器"><h3><span class="underlinegrey">联系我</span></h3><h1>给我发送电子邮件至 <a href="#">stewartehoff@gmail.com</a>或在以下位置找到我:</h1><div class="row"><div class="col-md-6"><img src="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/images/github.png"><p>Github</p>

    <div class="col-md-6"><img src="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/images/linkedin.png"><p>领英</p>

    <!--FLIPBOARD 从这里开始--><!--在此处编辑幻灯片--><div class="探索"><div class="容器"><h3><span class="underline">探索</span></h3><p>我喜欢在旅途中探索和捕捉史诗般的时刻.这是我最近一次穿越美国西海岸的旅行中我最喜欢的一些.</p>

    <div class="slider"><!--幻灯片 1 开始--><div class="slide active-slide slide-feature slide-feature-1"><div class="容器"><div class="row">

    <!--幻灯片 1 结束--><!--幻灯片 2 开始--><div class="slide slide-feature slide-feature-2"><div class="容器"><div class="row">

    <!--幻灯片 2 结束--><!--幻灯片 3 开始--><div class="slide slide-feature slide-feature-3"><div class="容器"><div class="row">

    <!--幻灯片 3 结束--><!--幻灯片 4 开始--><div class="slide slide-feature slide-feature-4"><div class="容器"><div class="row">

    <!--幻灯片 4 结束--><!--幻灯片 5 开始--><div class="slide slide-feature slide-feature-5"><div class="容器"><div class="row">

    <!--幻灯片 5 结束-->

    <!--滑块导航.添加更多

  • &bull;</li>"更多幻灯片.--><div class="slider-nav"><a href="#" class="arrow-prev"><img src="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/images/arrow-left.svg"></a><ul class="slider-dots"><li class="dot active-dot">&bull;</li><li class="dot">&bull;</li><li class="dot">&bull;</li><li class="dot">&bull;</li><li class="dot">&bull;</li><a href="#" class="arrow-next"><img src="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/images/arrow-right.svg"></a>

    <!--FLIPBOARD 在这里结束-->

    <div class="音乐"><div class="容器"><h3><span class="underlinegrey">音乐</span></h3><h1>在我十几岁的时候,我购买了我的第一个架子鼓.现在,我不仅仅是一个鼓手,我还是一个音乐制作人.以下是我的作品集中的一些曲目:</h1><!--默默无闻--><iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/149734252&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe&;<!--欺骗--><iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/154191965&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe&;<!--昼夜节律--><iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/154192672&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe&;<!--超人--><iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/73625501&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"</iframe><h1>更多我的音乐,请访问我的<a href='#'>SoundCloud</a>个人资料.

    <div class="footer"><div class="容器"><h1>Stewart Ehoff 的网站</h1><p>希望您喜欢访问我的网站.请不要犹豫与我联系,我会<b>爱</b>收到您的来信!</p>

    </html>

    I've been making my first website - a single page site with different sections containing content. I've created a nice looking navbar and have been scouring the internet to try and find a way to add functionality to it.

    Here is the markup of the navbar:

    <div class="nav">
      <div class="container">
        <div class="title">    
            <h3>Stewart Ehoff</h3>
        </div>    
        <a href="#" class="logo-icon">
          <img src="images/shield.svg">
        </a>   
    
        <ul class="menu">
          <li><a href="#home">Home</a></li>
          <li><a href="#about">About</a></li>
          <li><a href="#myskills">My Skills</a></li>
          <li><a href="#mywork">My Work</a></li>
          <li class="border"><a href="#">Contact Me</a></li>
          <li class="dropdown">
            <a href="#" class="dropdown-toggle">More<b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="#exploration">Exploration</a></li>
              <li><a href="#music">Music</a></li>
            </ul>
          </li>
        </ul>
      </div>
    </div>
    

    );

    Thanks in advance.

    解决方案

    I checked your page on github and added ID's to your content. If you do for example: then you will go to a container with id="id".

    For example with your page i added:

    <li><a href="#myskills">My Skills</a></li>
    

    with the HTML

    <div id="myskills">
    

    Here is the full HTML.

    //More Menu Dropdown Toggle Function
    
    var main = function() {
      $('.dropdown-toggle').click(function() {
        $('.dropdown-menu').toggle();
    
      });
      //Next Arrow Functionality    
      $('.arrow-next').click(function() {
    
        var currentSlide = $('.active-slide');
        var nextSlide = currentSlide.next();
        var currentDot = $('.active-dot');
        var nextDot = currentDot.next();
    
        if (nextSlide.length == 0) {
          nextSlide = $('.slide').first();
          nextDot = $('.dot').first();
        }
    
        currentSlide.fadeOut(600).removeClass('active-slide');
        nextSlide.fadeIn(600).addClass('active-slide');
    
        currentDot.removeClass('active-dot');
        nextDot.addClass('active-dot');
    
      });
      //Previous Arrow Click Functionality
      $('.arrow-prev').click(function() {
    
        var currentSlide = $('.active-slide');
        var prevSlide = currentSlide.prev();
    
        var currentDot = $('.active-dot');
        var prevDot = currentDot.prev();
    
        if (prevSlide.length == 0) {
          prevSlide = $('.slide').last();
          prevDot = $('.dot').last();
        }
    
    
        currentSlide.fadeOut(600).removeClass('active-slide');
        prevSlide.fadeIn(600).addClass('active-slide');
    
        currentDot.removeClass('active-dot');
        prevDot.addClass('active-dot');
    
      });
    };
    
    $(document).ready(main);

    /* General */
    
    .container {
      width: 960px;
    }
    .underline {
      border-bottom: 3px solid #7FCCE5;
    }
    .underlinegrey {
      border-bottom: 3px solid #808080;
    }
    .underlineblack {
      border-bottom: 3px solid #313131;
    }
    .underlinethin {
      border-bottom: 1px solid #7FCCE5;
    }
    .circle-icon {
      width: 80px;
      height: 80px;
      text-align: center;
      4 line-height: 80px;
      font-size 2.1em;
      border-radius: 40px;
      margin: auto;
      color: #aaa;
      background-color: #ddd;
    }
    .glyphicon {
      position: relative;
      display: inline-block;
      font-family: 'Glyphicons Halflings';
      font-style: normal;
      font-weight: 400;
      font-size: 35px;
    }
    .circle-icon .glyphicon {
      top: 0;
      line-height: 80px;
      text-align: center;
    }
    /* Nav Bar */
    
    .nav {
      background-color: rgba(255, 255, 255, 0.95);
      border-bottom: 1px solid #ddd;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      font-size: 17px;
      padding: 5px;
      position: fixed;
      top: 0;
      left: 0;
      z-index: 9999;
      width: 100%;
    }
    .nav .title {
      position: fixed;
      left: 100px;
      top: -10px;
    }
    .logo-icon {
      position: fixed;
      left: 500px;
      top: 8px;
    }
    /* Menu */
    
    .nav .menu {
      float: right;
      list-style: none;
      margin-top: 5px;
    }
    .menu > li {
      display: inline;
      padding-left: 30px;
      padding-right: 30px;
    }
    .menu a {
      color: #898989;
    }
    .menu .border a {
      border: 1px solid #7FCCE5;
      padding: 15px;
      padding-top: 2px;
      padding-bottom: 2px;
    }
    /* Dropdown */
    
    .dropdown-menu {
      font-size: 16px;
      margin-top: 5px;
      min-width: 105px;
      z-index: 999;
    }
    .dropdown-menu li a {
      color: #898989;
      padding: 6px 20px;
      font-weight: 300;
    }
    /* Jumbotron */
    
    .jumbotron {
      background-image: url('http://p1.pichost.me/i/58/1822942.jpg');
      height: 1020px;
      background-repeat: no-repeat;
      background-size: cover;
      position: initial;
    }
    .jumbotron .container {
      position: relative;
      top: 250px;
    }
    .jumbotron h1 {
      color: #fff;
      font-size: 80px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      text-align: center;
      padding: 20px;
      text-shadow: 0px 0px 3px #000;
    }
    .jumbotron p {
      color: #fff;
      font-size: 48px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      text-align: center;
      padding: 20px;
      text-shadow: 0px 0px 3px #000;
    }
    .jumbotron h3 {
      color: #fff;
      font-size: 80px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      text-align: center;
      padding: 20px;
      text-shadow: 0px 0px 3px #000;
    }
    .btn {
      display: inline-block;
      padding: 4px 14px;
      margin-bottom: 0px;
      font-size: 13px;
      text-align: center;
      vertical-align: middle;
      cursor: pointer;
      border-radius: 1px;
      border-color: #f7f6f6;
      line-height: 20px;
      font-weight: bold;
      color: #f7f6f6;
      background-color: transparent;
      position: relative;
      top: 50px;
      left: 340px;
    }
    .btn:hover {
      background-image: none;
      background-color: #808080;
      color: #f7f6f6;
    }
    /* About Me */
    
    .about {
      height: 600px;
      background-color: #ffffff;
    }
    .about .container {
      top: 35px;
      position: relative;
    }
    .about h3 {
      color: #313131;
      font-size: 40px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding;
      20px;
      text-align: center;
    }
    .about p {
      position: relative;
      top: 20px;
      color: #313131;
      font-size: 20px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding: 30px;
      line-height: 210%;
    }
    /* My Skills  */
    
    .myskills {
      height: 880px;
      background-color: #F7F6F6;
    }
    .myskills .container {
      width: 1500px;
      position: relative;
      top: 35px;
    }
    .myskills .row {
      position: relative;
      text-align: center;
      top: 80px;
      padding-bottom: 50px;
    }
    .myskills h3 {
      color: #808080;
      font-size: 40px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      text-align: center;
    }
    .myskills h1 {
      color: #808080;
      font-size: 25px;
      font-family: 'Oswald', sans-serif;
      font-weight: 400;
      text-align: center;
      padding-bottom: 50px;
    }
    .myskills p {
      color: #808080;
      font-size: 20px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding;
      20px;
      text-align: center;
      line-height: 200%;
    }
    .glyphicon-heart {
      color: red;
    }
    .glyphicon-picture {
      color: orange;
    }
    .glyphicon-cloud {
      color: white;
    }
    .glyphicon-camera {
      color: black;
    }
    .glyphicon-book {
      color: darkviolet;
    }
    .glyphicon-music {
      color: orangered;
    }
    /* My Work */
    
    .mywork {
      height: 400px;
      background-color: #FFFFFF;
    }
    .mywork .container {
      position: relative;
      top: 35px;
    }
    .mywork h3 {
      color: #313131;
      font-size: 40px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding-bottom: 40px;
      text-align: center;
    }
    .mywork h1 {
      color: #313131;
      font-size: 30px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding-bottom: 20px;
      text-align: center;
    }
    .mywork p {
      color: #313131;
      font-size: 20px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding: 50px;
      text-align: center;
    }
    /* Contact */
    
    .contact {
      height: 330px;
      background-color: #313131;
    }
    .contact .container {
      position: relative;
      top: 35px;
    }
    .contact .row {
      width: 300px;
      position: relative;
      left: 325px;
      text-align: center;
      top: 30px;
      padding-bottom: 40px;
    }
    .contact h3 {
      color: #F7F6F6;
      font-size: 40px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding;
      20px;
      text-align: center;
    }
    .contact h1 {
      color: #808080;
      font-size: 20px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding: 10px;
      text-align: center;
    }
    .contact p {
      color: #F7F6F6;
      font-size: 16px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding-bottom: 15px;
      text-align: center;
    }
    .contact a {
      color: #7FCCE5;
    }
    /* Exploration */
    
    .exploration {
      height: 1100px;
      background-color: #ffffff;
    }
    .exploration .container {
      position: relative;
      top: 35px;
      width: 1200px;
    }
    .exploration h3 {
      color: #313131;
      font-size: 40px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding-bottom: 20px;
      text-align: center;
    }
    .exploration p {
      color: #313131;
      font-size: 20px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      text-align: center;
    }
    .slider {
      position: relative;
      top: 50px;
      width: 100%;
      height: 800px;
    }
    .slide {
      display: none;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
    .active-slide {
      display: block;
    }
    /* Slide feature */
    
    .slide-feature {
      text-align: center;
      height: 800px;
    }
    .slide-feature-1 {
      background-image: url('https://scontent-lhr.xx.fbcdn.net/hphotos-xaf1/t31.0-8/11036160_10152854777396270_5157414753497878003_o.jpg');
      background-position: center;
    }
    .slide-feature-2 {
      background-image: url('https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xta1/t31.0-8/11218515_10152909922431270_7749144937209461633_o.jpg');
      background-position: center;
    }
    .slide-feature-3 {
      background-image: url('https://scontent-lhr.xx.fbcdn.net/hphotos-xpa1/t31.0-8/11187795_10152891725491270_1769195601160147349_o.jpg');
      background-position: bottom;
    }
    .slide-feature-4 {
      background-image: url('https://scontent-lhr.xx.fbcdn.net/hphotos-xaf1/t31.0-8/11154672_10152854784061270_3532862830070230799_o.jpg');
      background-position: center;
    }
    .slide-feature-5 {
      background-image: url('https://scontent-lhr.xx.fbcdn.net/hphotos-xap1/t31.0-8/11164749_10152909922426270_8192461025609874418_o.jpg');
      background-position: center;
    }
    .slide-feature img {
      margin-top: 112px;
      margin-bottom: 28px;
    }
    .slider-nav {
      text-align: center;
      margin-top: 20px;
    }
    .arrow-prev {
      margin-right: 45px;
      display: inline-block;
      vertical-align: top;
      margin-top: 9px;
      position: relative;
      top: 40px;
    }
    .arrow-next {
      margin-left: 45px;
      display: inline-block;
      vertical-align: top;
      margin-top: 9px;
      position: relative;
      top: 40px;
    }
    .slider-dots {
      list-style: none;
      display: inline-block;
      padding-left: 0;
      margin-bottom: 0;
      position: relative;
      top: 40px;
    }
    .slider-dots li {
      color: #bbbcbc;
      display: inline;
      font-size: 30px;
      margin-right: 5px;
    }
    .slider-dots li.active-dot {
      color: #7FCCE5;
    }
    /*Music*/
    
    .music {
      height: 1200px;
      background-color: #313131;
    }
    .music .container {
      position: relative;
      top: 35px;
      width: 1500px;
    }
    .music h3 {
      color: #F7F6F6;
      font-size: 40px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding-bottom: ;
      40px;
      text-align: center;
    }
    .music h1 {
      color: #808080;
      font-size: 20px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding: 30px;
      text-align: center;
    }
    .music p {
      color: #F7F6F6;
      font-size: 16px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding-;
      text-align: center;
    }
    iframe {
      position: relative;
      top: 10px;
      margin: 20px;
    }
    /* Footer */
    
    .footer {
      height: 200px;
      background-color: #F7F6F6;
    }
    .footer h1 {
      color: #808080;
      font-size: 20px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      text-align: center;
      padding-bottom: 50px;
      position: relative;
      top: 35px;
    }
    .footer p {
      color: #808080;
      font-size: 16px;
      font-family: 'Oswald', sans-serif;
      font-weight: 300;
      padding;
      20px;
      text-align: center;
      line-height: 200%;
    }

    <!doctype html>
    <html>
    
    <head>
      <link href='http://fonts.googleapis.com/css?family=Oswald:400,300' rel='stylesheet'>
      <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
      <link href="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/style.css" rel="stylesheet">
      <script src="http://code.jquery.com/jquery-latest.js"></script>
    </head>
    
    <body>
    
      <!-- NAV BAR -->
      <div class="nav">
        <div class="container">
          <div class="title">
            <h3>Stewart Ehoff</h3>
          </div>
          <a href="#" class="logo-icon">
            <img src="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/images/shield.svg">
          </a>
    
          <ul class="menu">
            <li><a href="#">Home</a>
            </li>
            <li><a href="#about">About</a>
            </li>
            <li><a href="#myskills">My Skills</a>
            </li>
            <li><a href="#mywork">My Work</a>
            </li>
            <li class="border"><a href="#contactme">Contact Me</a>
            </li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle">More<b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="#">Exploration</a>
                </li>
                <li><a href="#">Music</a>
                </li>
              </ul>
            </li>
          </ul>
        </div>
      </div>
    
      <!--JUMBOTRON STARTS HERE-->
    
      <div class="jumbotron">
        <div class="container">
          <h1>Hello, world.</h1>
          <p>My name is <b>Stewart Ehoff</b> and I'm a self-taught web developer.</p>
          <h3>Let's work <em>together.</em> </h3>
    
          <button type="button" class="btn">TELL ME MORE</button>
          <button type="button" class="btn">RESUME</button>
    
        </div>
      </div>
    
      <!--JUMBOTRON ENDS HERE-->
    
      <!--ABOUT STARTS HERE-->
    
      <div class="about" id="about">
        <div class="container">
          <h3><span class="underline">About Me</span></h3> 
          <p>I'm a self-taught web developer living in Leicester, United Kingdom. I've been working with technology ever since I was a little boy.</p>
          <p>In 2014, I graduated from De Montfort University with a First Class Honours in Music, Technology and Innovation. Shortly after graduating, I recieved an internship at a professional audio solutions company, and went on to conduct work for companies
            such as Warner Records and Atlantic Records.</p>
          <p>This website is the fruits of my labour, I hope you enjoy it.</p>
        </div>
      </div>
    
      <!--MY SKILLS STARTS HERE-->
    
      <div class="myskills" id="myskills">
        <div class="container">
          <h3><span class="underlineblack">My Skills</span></h3>
    
          <!--Row 1-->
    
          <div class="row">
    
            <div class="col-md-4">
              <div class="circle-icon">
                <span class="glyphicon glyphicon-heart"></span>
              </div>
              <h1 class="underlinethin">Self-taught</h1> 
              <p>Everything I know I've taught myself. I'd like to think that shows a solid level of drive and dedication.</p>
            </div>
    
            <div class="col-md-4">
              <div class="circle-icon">
                <span class="glyphicon glyphicon-picture"></span>
              </div>
              <h1 class="underlinethin">Front end development</h1> 
              <p>Able to create modern, beautifully designed websites with HTML, CSS and JavaScript that feel great to use.</p>
            </div>
    
            <div class="col-md-4">
              <div class="circle-icon">
                <span class="glyphicon glyphicon-cloud"></span>
              </div>
              <h1 class="underlinethin">Frameworks and libaries</h1> 
              <p>Confident with popular front-end (Bootstrap, jQuery) and back-end (Ruby on Rails) frameworks and libaries.</p>
            </div>
    
          </div>
    
          <!--Row 2-->
    
          <div class="row">
    
            <div class="col-md-4">
              <div class="circle-icon">
                <span class="glyphicon glyphicon-camera"></span>
              </div>
              <h1 class="underlinethin">Photography</h1> 
              <p>Photo taking, editting and asset creation in Adobe Photoshop and Lightroom.</p>
            </div>
    
            <div class="col-md-4">
              <div class="circle-icon">
                <span class="glyphicon glyphicon-book"></span>
              </div>
              <h1 class="underlinethin">Learning and problem solving</h1> 
              <p>Constantly striving for educational progression, experimenting with new technologies and refining skills. I see a problem as a challenge to learn.</p>
            </div>
    
            <div class="col-md-4">
              <div class="circle-icon">
                <span class="glyphicon glyphicon-music"></span>
              </div>
              <h1 class="underlinethin">Audio</h1> 
              <p>Audio engineer trained in building loudspeaker systems, recording, mixing and mastering audio.</p>
            </div>
    
          </div>
    
        </div>
      </div>
    
      <!--MY WORK STARTS HERE-->
    
      <div class="mywork" id="mywork">
        <div class="container">
          <h3><span class="underline">My Work</span></h3>
          <h1>Coming <i>soon...</i></h1>
          <p>I am always looking for exciting and innovative projects to work on. If you want to work together, then please <a href="contact">contact me!</a>
          </p>
        </div>
      </div>
    
      <!--CONTACT STARTS HERE-->
    
      <div class="contact" id="contactme">
        <div class="container">
          <h3><span class="underlinegrey">Contact Me</span></h3>
          <h1>Send me an email at <a href="#">stewartehoff@gmail.com</a> or find me on:</h1>
          <div class="row">
            <div class="col-md-6">
              <img src="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/images/github.png">
              <p>Github</p>
            </div>
            <div class="col-md-6">
              <img src="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/images/linkedin.png">
              <p>LinkedIn</p>
            </div>
          </div>
        </div>
      </div>
    
      <!--FLIPBOARD STARTS HERE-->
    
      <!--EDIT SLIDES HERE-->
    
      <div class="exploration">
    
        <div class="container">
          <h3><span class="underline">Exploration</span></h3>
          <p>I love exploring and capturing epic moments on my journeys. Here's some of my favourites from my latest trip across the west coast of America.</p>
        </div>
    
        <div class="slider">
    
          <!--SLIDE 1 START-->
    
          <div class="slide active-slide slide-feature slide-feature-1">
            <div class="container">
              <div class="row">
    
              </div>
            </div>
          </div>
    
          <!--SLIDE 1 END-->
    
          <!--SLIDE 2 START-->
    
          <div class="slide slide-feature slide-feature-2">
            <div class="container">
              <div class="row">
    
              </div>
            </div>
          </div>
    
          <!--SLIDE 2 END-->
    
          <!--SLIDE 3 START-->
    
          <div class="slide slide-feature slide-feature-3">
            <div class="container">
              <div class="row">
    
              </div>
            </div>
          </div>
    
          <!--SLIDE 3 END-->
    
          <!--SLIDE 4 START-->
    
          <div class="slide slide-feature slide-feature-4">
            <div class="container">
              <div class="row">
    
              </div>
            </div>
          </div>
    
          <!--SLIDE 4 END-->
    
          <!--SLIDE 5 START-->
    
          <div class="slide slide-feature slide-feature-5">
            <div class="container">
              <div class="row">
    
              </div>
            </div>
          </div>
    
          <!--SLIDE 5 END-->
    
        </div>
    
        <!--Slider navigation. Add more "<li class="dot">&bull;</li>" for more slides.-->
    
        <div class="slider-nav">
          <a href="#" class="arrow-prev">
            <img src="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/images/arrow-left.svg">
          </a>
          <ul class="slider-dots">
            <li class="dot active-dot">&bull;</li>
            <li class="dot">&bull;</li>
            <li class="dot">&bull;</li>
            <li class="dot">&bull;</li>
            <li class="dot">&bull;</li>
          </ul>
          <a href="#" class="arrow-next">
            <img src="https://raw.githubusercontent.com/Ardiaz/Stewart-Ehoff.com/master/images/arrow-right.svg">
          </a>
        </div>
    
      </div>
    
      <!--FLIPBOARD ENDS HERE-->
    
      </div>
    
      <div class="music">
        <div class="container">
          <h3><span class="underlinegrey">Music</span></h3>
          <h1>In my early teens, I purchased my first drum kit. Now, I'm more than just a drummer, I'm a music producer too. Here are a few tracks from my production portfolio:</h1>
    
          <!--Obscurity-->
    
          <iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/149734252&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe>
    
          <!--Deception-->
    
          <iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/154191965&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe>
    
          <!--Circadian-->
    
          <iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/154192672&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe>
    
          <!--Transhuman-->
    
          <iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/73625501&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe>
    
          <h1>For more of my music, please visit my <a href='#'>SoundCloud</a> profile.</h1>
    
    
        </div>
      </div>
    
      <div class="footer">
        <div class="container">
          <h1>A website by Stewart Ehoff</h1>
          <p>I hope you enjoyed visiting my website. Please don't hesitate to contact me, I would <b>love</b> to hear from you!</p>
        </div>
      </div>
    
    
    </body>
    
    </html>

    这篇关于单击导航栏时滚动到页面的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆