473,672 Members | 2,643 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to properly use an if/else structure to animate new content from the right?

74 New Member
How can I get my current content to slide to the left and bring in new content from the right (after clicking on button 1) when an existing student's username and password are correct, and if it's not correct display error messages that either the username or password isn't correct below each respective textbox .I am thinking about using an if/else condition. Also, how would I load the student's existing account information upon sliding it from the right, if I haven't created the content yet? If I already created the content to be slide in from the right, where do I hold that information until it's time to display that new content. Here is my code so far.

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.  
  3. <head>
  4.  
  5.   <link href="Home.css" rel="stylesheet" />
  6.   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  7.   <title>Project</title>
  8.  
  9. </head>
  10.  
  11. <body>
  12.  
  13.  
  14. <div class="container">
  15.   <div class="intro">
  16.  
  17.     <h1>Welcome to Cuyahoga Community College Student Services Online</h1>
  18.  
  19.     <p>Cuyahoga Community College recognizes students' rights to access personal and academic records in accordance with the Family Educational Rights and Privacy Act of 1974 (FERPA) as amended by Public Law 93-568.</p>
  20.   </div>
  21.   <br/>
  22.  
  23.   <div class="content">
  24.     <div class="row top">
  25.       <p id="para1">Already have an account with us? Returning users may log in by entering their site username and password. </p>
  26.       <div class="login">
  27.         <label class="username-label" for="username-part1">Username</label> &nbsp; 
  28.          <input class="existing1-username-input-textbox" type="text" value="" />
  29.         <br/><br/>
  30.         <label class="password-label" for="password-part2">Password</label> &nbsp; 
  31.         <input class="existing2-password-input-textbox" type="password" value="" />
  32.         <br/>
  33.         <button id="button1">Log in</button>
  34.       </div>
  35.     </div>
  36.     <hr/>
  37.     <div class="row bottom">
  38.       <p id="para2">New users, please create a new account by providing us with some basic information.</p>
  39.  
  40.       <div class= "new_customers_info">
  41.  
  42.         <label class="Username-label1" for="new-user-name-part-1">Username</label>
  43.         <input class="username-new-input-textbox" type="text" value="" />
  44.          <br/><br/>
  45.  
  46.         <label class="Password-label2" for="password-new-part2">Password</label>
  47.         <input class="password-new-input-textbox" type="password" value="" />
  48.          <br/><br/>
  49.  
  50.         <label class="Email-label3" for="email-new">Email Address</label>
  51.          <input class="email-new-input-textbox" type="text" value=""/>
  52.           <br/><br/>
  53.  
  54.         <label class="Repeat-Email-label4" for="repeat-new-email">Repeat Email Address</label>
  55.          <input class="reenter-new-input-textbox" type="text" value="" />
  56.  
  57.         <button id="button2">Create Account</button>
  58.       </div>
  59.     </div>
  60.   </div>
  61.    <br/>
  62.   <footer>Cuyahoga Community College</footer>
  63.   <footer>700 Carnegie Avenue, Cleveland, Ohio, 44115</footer>
  64. </div>
  65.     <script src="Home.js"></script>
  66. </body>
  67. </html>
Expand|Select|Wrap|Line Numbers
  1. .intro h1 {
  2.   font-family: 'Cambria';
  3.   font-size: 16pt;
  4.   font: bold;
  5.   text-align: left;
  6. }
  7.  
  8. .intro p {
  9.   font-family: 'Calibri';
  10.   font: italic;
  11.   font-size: 12pt;
  12.   padding: 0px 690px 0px 20px;
  13.   text-align: left;
  14. }
  15.  
  16. .content {
  17.   border: 2px solid;
  18.   -webkit-border-radius: 10px;
  19.   -moz-border-radius: 10px;
  20.   border-radius: 10px;
  21. }
  22.  
  23. #para1 {
  24.   padding: 0px 1050px 0px 20px;
  25. }
  26.  
  27. #para2 {
  28.   padding: 0px 1099px 0px 20px;
  29. }
  30.  
  31. .username-label,
  32. .password-label {
  33.  margin: 10px 0px 0px 300px;
  34.  position: relative; 
  35.  top: -70px; 
  36. }
  37.  
  38. .existing1-username-input-textbox, 
  39. .existing2-password-input-textbox
  40. {
  41.     top: -70px; 
  42.      position: relative; 
  43.  
  44. }
  45.  
  46. #button1{ 
  47.      background-color: #add8e6;
  48.      margin-left: 390px; 
  49.      position: relative; 
  50.      top: -50px; 
  51.     -webkit-border-radius: 10px;
  52.   -moz-border-radius: 10px;
  53.   border-radius:10px;
  54.   padding: 0px 20px 0px 20px; 
  55. }
  56.  
  57. #button2{
  58.   background-color: #add8e6;
  59.   margin-left: -200px; 
  60.   position: relative; 
  61.   top: -30px; 
  62.  -webkit-border-radius: 10px;
  63.   -moz-border-radius: 10px;
  64.   border-radius: 10px;
  65.   padding: 0px 20px 0px 20px; 
  66.  
  67. }
  68.  
  69.  
  70. .Username-label1, 
  71. .Password-label2,           
  72. .Email-label3, 
  73. .Repeat-Email-label4 
  74. {
  75.   margin: 0px 0px 0px 300px;
  76.   position: relative; 
  77.   top: -70px; 
  78. }
  79. .username-new-input-textbox, 
  80. .password-new-input-textbox, 
  81. .email-new-input-textbox, 
  82. .reenter-new-input-textbox{ 
  83.   position: relative;
  84.    top: -70px;
  85.   margin-left: 20px; 
  86.  
  87.  
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("button1").onmouseover = function() {mouseOver1()}; 
  2.  
  3. document.getElementById("button1").onmouseout  = function() {mouseOut1()}; 
  4.  
  5.     function mouseOver1(){ 
  6.  
  7.       document.getElementById("button1").style.color = "red";
  8.    }
  9.  
  10. function mouseOut1(){ 
  11.  
  12.       document.getElementById("button1").style.color = "black";
  13.    }
  14.  
  15.  
  16.  
  17. document.getElementById("button2").onmouseover = function() {mouseOver()}; 
  18.  
  19. document.getElementById("button2").onmouseout  = function() {mouseOut()}; 
  20.  
  21.     function mouseOver(){ 
  22.  
  23.       document.getElementById("button2").style.color = "purple";
  24.    }
  25.  
  26. function mouseOut(){ 
  27.  
  28.       document.getElementById("button2").style.color = "black";
  29.    }
  30.  
  31.  
  32. $("#button1").hover(function() {
  33.     $(this).css('cursor','pointer');
  34. }); 
  35.  
  36. $("#button2").hover(function() {
  37.     $(this).css('cursor','pointer');
  38. }); 
  39.  
  40.  $(document).ready(function(){
  41.         $("#button1").click(function(){ 
  42.  
  43.        if(username.value== "Micheal" && password.value== "honor7thG") { 
  44.  
  45.             $('#para1').hide("slide", {direction: "left" }, 1000); 
  46.             $('.username-label').hide("slide", {direction: "left" }, 1000);
  47.             $('.existing1-username-input-textbox').hide("slide", {direction: "left" }, 1000);
  48.             $('.password-label').hide("slide", {direction: "left" }, 1000);
  49.             $('.existing2-password-input-textbox').hide("slide", {direction: "left" }, 1000);
  50.  
  51.             $('').show("slide", { direction: "right" }, 1000);   
  52.  
  53.  
May 3 '17 #1
0 33470

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2589
by: Warren Post | last post by:
Here's a problem I've never seen before. On <http://snow.prohosting.com/srcopan/anti/>, should the viewport width be less than the width of the page's header, then the right margin becomes stuck at the viewport's right edge. This is perhaps better observed than described; try it yourself at narrow viewport widths and/or high zoom levels. I am guessing that I've mucked up something in the CSS's margin settings, but I can't find it by...
11
2406
by: Mannequin* | last post by:
Hi all, I'm working on a quick program to bring the Bible into memory from a text file. Anyway, I have three questions to ask. First, is my implementation of malloc () correct in the program to follow? Second, have I correctly passed the structure's pointer to the functions in this program?
4
2595
by: Marty | last post by:
Hi, Can I animate the content of a picturebox? I mean, I have a static boat picture that I inserted in a picture box, and I would like to programmatically make some water wave around it. Is there any tutorial of example of such a thing? Thank you! Marty
0
1621
by: TN Bella | last post by:
Hi, I am trying to get my compare validator to fire properly...Since I have panels the validator wouldn't work properly, the app would fire right but would insert the data regardless and the user couldn't fix an error if they had an error. So I added another sub and fixed the panels, but the compare validator still doesn't work right. Right now the validator pops up with the error that the two values (txtAcctAmtSum and txtInvAmt) are...
9
1929
by: wardy | last post by:
I'm trying to undestand the impact of using content negotiation when rendering my Web pages to various different browsers as I would like to use the XHTML Strict DOCTYPE declaration. Reading the W3C guidelines, if I render as 'text/html' then there are some backward compatibility issues I need to worry about. Does this mean that the page must be rendered in one way if I use the "application/xhmlt+xml" content type and another if I use...
2
8781
by: Lawrence | last post by:
Hi I have only begun to look into ASP due to an assignments requirements (I usually code in PHP), one feature in PHP is to be able to do an if...else statement, where if a certain statement is true then a chunk of HTML can be outputted... Basically I want to be able to do this in ASP to use with a simple authentication system which I will construct.
38
2236
by: sam_cit | last post by:
Hi, I have the following Struct, Struct Sample { int i; char *p; };
7
1536
by: Ixiaus | last post by:
I have just come across a site that discusses Python's 'for' and 'while' loops as having an (optional) 'else' structure. At first glance I interpreted it as being a bit like the 'default' structure in PHP's switch block... But the switch block isn't a loop, so, I am now confused as to the reason for using 'else' with the for and while loops... A few quick tests basically show that statements in the else structure are executed at the...
1
2221
by: vesnianka | last post by:
Hi! I was asked by a client to develop a web forum, in structure and content. My question is, how do I document the structure of a forum, for my client? Is it done as a site map? a mock-up? a diagram? Does anyone have a template that I can use, to customize how I would like the structure of the forum to look? Any ideas, pointers or professional recommendations? I am looking for formalize this process. Thanks so much!
0
1365
by: dantz | last post by:
Hi, Can someone please help me convert my C structure/function into C#? I really need this badly... I believe I can call the DLL properly if I have able to correctly convert the function and marshal properly my structure. Here is my struct and the function that uses it: typedef struct UIclient_info { char name; int age;
0
8488
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8932
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8832
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8617
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7449
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6240
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4424
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1821
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.