I am currently in the process of developing a website that aims to incorporate a significant amount of motion and interactivity. The concept I have devised involves a scenario where clicking on a button from the "main menu" will trigger a horizontal and vertical scroll to the corresponding content linked to that specific button. For instance, upon selecting the "Info about Dogs" button, the page would smoothly transition to relevant information pertaining to dogs.
Despite using the ScrollTo() jQuery plugin for initiating the scrolling mechanism, I am encountering difficulties with achieving both vertical and horizontal scrolls concurrently.
Here is my HTML:
<!-- Head section includes references to stylesheets and essential details -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="stylesheets/index.css" rel="stylesheet" type="text/css" />
<link href="http://fonts.googleapis.com/css?family=Walter+Turncoat" rel="stylesheet" type="text/css" />
</head>
<body>
<section class="wrapper" id="wrapper">
<section class="mainMenu" id="mainMenu">
<section class="topRow">
<a href="#" target="_self" id="aboutInfo"><img src="assets/placeholder_icon.jpg" alt="placeholder icon" class="aboutIcon" id="aboutIcon"></a>
<img src="assets/placeholder_icon.jpg" alt="placeholder icon" class="projectsIcon" id="projectsIcon">
</section>
<section class="middleRow">
<img src="assets/placeholder_icon.jpg" alt="placeholder icon" class="feedbackIcon" id="feedbackIcon">
<img src="assets/placeholder_icon.jpg" alt="placeholder icon" class="contactIcon" id="contactIcon">
</section>
<section class="bottomRow">
<img src="assets/placeholder_icon.jpg" alt="placeholder icon" class="blogIcon" id="blogIcon">
<img src="assets/placeholder_icon.jpg" alt="placeholder icon" class="resumeIcon" id="resumeIcon">
</section>
</section>
<section class="about" id="about">
<p>Hello, world</p>
</section>
</section>
<footer>
Copyright © 2015
</footer>
CSS:
/* DOM setup */
html
{
display: block; /* Set the DOM as a block */
overflow: hidden; /* Conceal the scrollbar */
background: url(../assets/background.jpg) repeat; /* Background image for the page */
color: #FFF; /* Text color */
margin: 0px; /* Remove default margin */
padding: 0px; /* Remove default padding */
border: none; /* Remove default borders */
font-family: 'Walter Turncoat', 'Bradley Hand ITC', arial; /* Font style */
}
/* Top row settings */
.topRow
{
margin: 200px 0px 0px;
}
.aboutIcon
{
height: 64px;
width: 64px;
margin-left: 700px;
}
.projectsIcon
{
height: 64px;
width: 64px;
margin-left: 370px;
}
/* Middle row settings */
.middleRow
{
margin: 100px 0px 0px;
}
.feedbackIcon
{
height: 64px;
width: 64px;
margin-left: 550px;
}
.contactIcon
{
height: 64px;
width: 64px;
margin-left: 650px;
}
/* Bottom row settings */
.bottomRow
{
margin: 100px 0px 0px;
}
.blogIcon
{
height: 64px;
width: 64px;
margin-left: 700px;
}
.resumeIcon
{
height: 64px;
width: 64px;
margin-left: 370px;
}
.about
{
display: block;
width: 720px;
height: 1080px;
margin: 6000px 0px 0px 10000px;
}
/* Footer customization */
footer
{
height: 30px;
width: 500px;
margin: 200px auto 0px;
text-align: center;
font-size: 20px;
font-weight: 500;
}
JavaScript:
$(document).ready(function()
{
animateIcons();
$("#about").hide();
$("#projects").hide();
$("#feedback").hide();
$("#contact").hide();
$("#blog").hide();
$("#resume").hide();
function animateIcons()
{
// Icon animations using the circulate plug-in
$("#aboutIcon").circulate(
{
speed: 2000,
height: 5,
width: 25,
sizeAdjustment: 100,
loop: true,
zIndexValues: [1, 1, 1, 1]
});
$("#projectsIcon").circulate(
{
speed: 2800,
height: 11,
width: -25,
sizeAdjustment: 100,
loop: true,
zIndexValues: [1, 1, 1, 1]
});
$("#feedbackIcon").circulate(
{
speed: 1500,
height: -15,
width: 10,
sizeAdjustment: 100,
loop: true,
zIndexValues: [1, 1, 1, 1]
});
$("#contactIcon").circulate(
{
speed: 1500,
height: 15,
width: 10,
sizeAdjustment: 100,
loop: true,
zIndexValues: [1, 1, 1, 1]
});
$("#blogIcon").circulate(
{
speed: 2800,
height: 11,
width: -25,
sizeAdjustment: 100,
loop: true,
zIndexValues: [1, 1, 1, 1]
});
$("#resumeIcon").circulate(
{
speed: 2000,
height: 5,
width: 25,
sizeAdjustment: 100,
loop: true,
zIndexValues: [1, 1, 1, 1]
});
}
});
$("#aboutInfo").click(function()
{
$("#about").scrollTo();
$("#about").show("slow");
});