0

Hi there,

I'm interested in creating a one page website with wordpress (the one with multiple pages in one with the scrollbar). I was curious whether anyone knows of a great website that has tutorials for this or someone that can give me a bit of information on how to make one.

Thanks!

3
Contributors
2
Replies
5
Views
4 Years
Discussion Span
Last Post by bestwsd
0

What you need to learn is some CSS, and jQuery. Although jQuery's optional, if you're not that familiar with vanilla javascript, then it's a good choice to use.

If you need your content to be fetch from the server, AJAX's needed.
Here's a simple code I made to give you some headsup: JS Fiddle Example <- Check this link

HTML:

<div id="wrapper">
  <div>
    <span>1</span>
    <span>2</span>
    <span>3</span>
  </div>
  <div class="contents showCont">This is content one</div>
  <div class="contents">This is content two</div>
  <div class="contents">This is content three</div>
</div>

JAVASCRIPT:

$(document).ready(function(){
  $("div span").on('click',function(){
    var $this = $(this),
        targetContent = parseInt($this.html())-1;

    //remove the corrent content from view
    $("div .showCont").removeClass("showCont");

    //show the selected content
    $(".contents:eq("+targetContent+")").addClass("showCont");

  });
});

CSS:

.contents{
  display:none;
}
.showCont{
  display:block;
}

/* Nothing important */
div span{
  border: black solid 1px;
}

Edited by gon1387

0

in wordpress you can control this setting with widgets....... as per your need you need two col website ......... search google you can find many free wordpress theme as per your choice.

here you can find theme.

wordpress.org/extend/themes/browse/popular/

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.