February 15, 201313 yr I'm just wondering how those stylish one page websites are made? They have anchor links at the top which automatically scroll down the page when clicked (via jQuery I presume). Thanks
February 15, 201313 yr Exactly right. Most of them use Jquery to do this. Check out Jquery ScrollTo plugin. Does exactly this (and you can do some other cool things with it.)
February 15, 201313 yr Or if you want to step it up a notch, have a look at 'HTML5/CSS3 parallax' on Google. Here's an example - just load and click a nav item (or scroll). Edited February 15, 201313 yr by andy9l
February 15, 201313 yr They are basically anchor tags that given a nice smooth scrolling effect using jQuery.
February 15, 201313 yr Author Thanks for the reply guys, anyone know how to actually make a one page site?
February 15, 201313 yr When you say "actually make one" do you mean, how do you code it? Edited February 15, 201313 yr by AaronAlderman
February 15, 201313 yr Author Yes, I know its CSS(3), HTML(5) etc but i'm unsure how to find the correct sizes etc.
February 15, 201313 yr Sorry when you say sizes are we talking about screen sizes to make it responsive?
February 15, 201313 yr Author Nooo, well kind of yes. Like, how big each section needs to be in order to fill the screen. Height 100% wouldnt work because it would fill the whole screen? I need different pages to be different background colours. I'll try and find an example.
February 15, 201313 yr Ah I see, well if you want them to all be exactly the height of the browser (or taller), perhaps some jQuery: var height = $(window).height(); $(".page").css("min-height", height + "px");Then your markup: <section class="page"> <h2>Section one...</h2> <p>Etc.</p> </section> <section class="page"> <h2>Section two...</h2> <p>Etc.</p> </section>Although there are likely CSS alternatives, or better ways to approach the whole thing. Edited February 15, 201313 yr by andy9l
Create an account or sign in to comment