JQuery Page Slider. Our goal is to get to the functionality of the Panic Coda web site.Panic Coda web site.

Slides:



Advertisements
Similar presentations
JQuery MessageBoard. Lets use jQuery and AJAX in combination with a database to update and retrieve information without refreshing the page. Here we will.
Advertisements

Getting Started with PowerPoint
Chapter 3 – Web Design Tables & Page Layout
Nvu - How to Create Your Own Website From Start to Finish!Dr. Dawn Sherry & Dr. Barry J. Monk Dr. Dawn Sherry Dr. Barry J. Monk Assistant Professor of.
PowerPoint Basics   Tutorial 5: Navigation
HIGH LEVEL OVERVIEW: CSS CSS SYNTAX CONSISTS OF A SET OF RULES THAT HAVE 3 PARTS: A SELECTOR, A PROPERTY, AND A VALUE. IT’S NOT NECESSARY TO REMEMBER THIS.
Cascading Style Sheets
MIS 425 Lecture 2 – HTML Navigation, Colors, tables and Styles Instructor: Martin Neuhard
Chapter 3 – Designing your web pages Dr. Stephanos Mavromoustakos.
Very quick intro HTML and CSS. Sample html A Web Title.
INTRODUCTORY Tutorial 7 Creating Liquid Layouts. XP Objectives Discern the differences among various types of layouts Create a liquid layout Create a.
Advance CSS (Menu and Layout) Miftahul Huda. CSS Navigation MENU It's truly remarkable what can be achieved through CSS, especially with navigation menus.
FrontPage Express By John G. Summerville Ph.D.©, RN.
Web Pages and Style Sheets Bert Wachsmuth. HTML versus XHTML XHTML is a stricter version of HTML: HTML + stricter rules = XHTML. XHTML Rule violations:
Dawn Pedersen Art Institute. What is Spry? Spry is Dreamweaver’s version of JavaScript libraries. Spry effects alter the look of a page element—or of.
11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
Newsletter Plugin The newsletter plugin allows you to create and send newsletters to a managed list or multiple lists of users. Your users can subscribe.
Using color and fonts in HTML and XHTML Please use speaker notes for additional information!
HTML. Goals How to use the Komodo editor HTML coding and testing Basic HTML tags List and Images Tables and Links At least 2 pages and navigation
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
HTML Tags. Objectives Know the commonly used HTML tags Create a simple webpage using the HTML tags that will be discussed.
Created in 2011 at Liberty High School. Getting Started Overview on Magnet Tool – Graphics – Text – Image – Video – Sound – Wall A Sample Glog How to.
INFSCI  Start with a skeleton outline: copy and paste:  Warning sometimes copy and paste of quote marks from PowerPoint doesn’t work correctly.
® IBM Software Group © 2006 IBM Corporation Creating JSF/EGL Template Pages This section describes how to create.JTPL (Java Template Pages) using the Page.
CIT 256 Organizing Large Websites: Divs, DW Templates Dr. Beryl Hoffman.
Creating A Simple Web Page. Step 1- Open Dreamweaver & Create A New Page (File New) and blank.
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit F Working with Tables.
ITP 104.  While you can do things like this:  Better to use styles instead:
The Characteristics of CSS
INFSCI  Last time we built a doggie web page in class following the instructions in the slide deck: Build Web Page with HTML – see week 3 The topics.
Eat Your Words! Creating webpage Layout. CONTENT The Layout of a Webpage HEADER FOOTER Each of these sections represents a ‘div’ (or divider). By linking.
Website Research By Sophie Hiscock. Fan Marvel Website You know this website is Marvel because of the characters from the comics are in the body, which.
CSS Sprites. What are sprites? In the early days of video games, memory for graphics was very low. So to make things load quickly and make graphics look.
Basic Responsive Design Techniques. Let’s take a look at this basic layout. It has a header and two columns of text, in a box that is centered on the.
creating a page layout With the index.htm and recipe.htm pages you created, you got some hands-on practice creating different kinds of design elements.
There are lots of wikis out there… But I like…. A how-to for the classroom.
Bill's Amazing Content Rotator jQuery Content Rotator.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Cascading Style Sheets Dave Edsall IAGenWeb County Coordinator’s Conference June 30, 2007.
INTRODUCTION TO HTML5 Semantic Layout in HTML5.  The new semantic layout in HTML5 refers to a new class of elements that is designed to help you understand.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
HTML Concepts and Techniques Fifth Edition Chapter 6 Using Frames in a Web Site.
More CSS.
USING WORDPRESS TO CREATE A WEBSITE (RATHER THAN A BLOG) STEP-BY-STEP INSTRUCTIONS.
WRA HTML & CSS – BUILDING WEBPAGES. TODAY’S AGENDA Review: external stylesheets Review: transforming a list Intro: the object Intro: the.
IT Introduction to Website Development Welcome!
 To begin you first need to sign up to Weebly by going to or alternatively and we will create an account.
Web Foundations WEDNESDAY, NOVEMBER 20, 2013 LECTURE 32: DREAMWEAVER SLIDE SHOW AND GOOGLE MAP.
HTML GUIDE Press F5 and then Click on the links on the left to get to the section you want Section 1: Getting Started Section 2: Moving Banner Section.
Web Design Part I. Click Menu Site to create a new site root.
Updated on: September 4, 2010 CIS67 Foundations for Creating Web Pages Professor Al Fichera.
USING WORDPRESS TO CREATE A WEBSITE (RATHER THAN A BLOG) STEP-BY-STEP INSTRUCTIONS.
Modifying HTML attributes and CSS values. Learning Objectives By the end of this lecture, you should be able to: – Select based on a class (as opposed.
Microsoft Expression Web-Illustrated Unit F: Enhancing a Design with CSS.
Introduction to CSS Layout
Positioning Objects with CSS and Tables
Getting Started with HTML. HTML  Hyper Text Markup Language  HTML isn’t a program language, its known as a markup language  A Markup language has tags.
Stylizing a Navigational Menu Web Design Section 6-3 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development.
Revised June 2008 Online PD Basic HTML1 Let’s Try It!  Open Notepad oStart > All Programs > Accessories > Notepad oDon’t get WordPad by mistake – won’t.
>> CSS Layouts. Recall Properties of Box – Border (style, width, color) – Padding – Margin – Display – Background – Dimension Welcome Padding Area Border.
Introduction to CSS Layout
More CSS.
>> Navigation and Layouts in CSS
Using DHTML to Enhance Web Pages
CSS Layouts: Positioning and Navbars
Creating a Baseline Grid
More CSS.
Tutorial 6 Creating Dynamic Pages
Modifying HTML attributes and CSS values
Presentation transcript:

jQuery Page Slider

Our goal is to get to the functionality of the Panic Coda web site.Panic Coda web site

We are going to start with this tutorialthis tutorial This will create the basic functionality of the page slider.

First thing I am going to do is link to the newer version of jQuery and the scrolling extension. Next I am going to move the script in the example file into its own linked file. Then pull out the CSS and put it in a linked file.

IMPORTANT: Before going on, test your file to make sure it works as expected. Next, I am going to put a background color in the body, just temporarily. I am going to remove the overflow:hidden; statement. If you view the page, you will notice that you do not see the blue. That is because of the crazy stuff in the wrapper rule. Next, I will alter the wrapper so that it is getting closer to the right size and shape. We can fix the margins to center the layout by adding text-align: center; to the body tag and the margin statement to the #wrapper rule.

Whip our content area into shape here. Next, to reach our goal, we need to move the menu out of the first item and into a over our scrolling area. This can be done by cutting and pasting it into a div with an ID of navigation.

Put it above the wrapper div. Then you just need to do some styling to get it to sit on top of it correctly. I also made the top margin on the wrapper div a little smaller. If you resize the window, you will see it gets a bit funky. Lets see if we can fix that.

if you look on your slider.js page you will see that there is a function that triggers when the window is resized. This was part of the original design for the tutorial. If you comment it out, you will see that it works fine without it. This means you can wipe out the whole resizePanel() function as well. Now the script is down to 15 lines.

The last thing to do for functionality is add the previous and next buttons. So I added a footer div under the wrapper div. Notice the links don't actually go anywhere. Then I gave it a little styling. The whole project can be styled better later. This will do for now

To get the next and previous links to work, we need to come up with a strategy. Think about how you think it should work. When I thought about it, I thought that we are going to have to somehow know where we are currently, then find a way to slide to the next or previous item, as necessary. I noticed this variable is being set in our script: current = $(this); This was left over from the window resize script, which we deleted. If I tell current to put a red two pixel border around it, and test it, this is what I get when I click on a page.

So, now I know where I am. How do I know where I am going? jQuery, as we know has a million ways of selecting stuff on the page. There must be one for selecting the next item or the previous item in the DOM. And of course there is! The next() and prev() functions will work nicely. Notice in the picture I am on item2, but the 3 in the navigation has the red border.

I am going to set up an event handler for when someone clicks on the link with an ID of #next. we can modify the statement in the other handler to match what we need for the next link.

When you test that, you will see that first you have to click a page, then you can click the next link and it will work once, but not after that. If we reassign the next element to current, it should work until you get to the last one. If we are on the last slide, we want to go back to the first slide. Sounds like an if statement! Ok, this looks a little weird, but this is how its done with jQuery. Basically, if the length of the next sibling element is zero (meaning it does not exist) we can send the user back to the beginning – we have to write that still. Else, just go to the next item.

Here it is. We can select the first child of our navigation div and scroll to it. One more thing. Assign our variable, current, to that first item. Our next link should be fully functional.

The function for the previous link, is really just a copy and paste of the one for the next link. Just change it to.prev in the appropriate places and set the a:last-child properly. That should be working perfectly. If you load the page from scratch you will notice that you have to click a menu button before clicking a next or previous button. That is because that current variable is being set for the first time after you click a button for a particular page. Lets fix that.

Right at the top of the page, I set current to the first item in the navigation. One minor detail, you might notice. When you click the item links, It goes to the item and makes that item bold in the menu. However, it does not do that when you click the next and previous links. The code responsible for doing that is on lines 7 & 8. We could add those two lines to our click handlers for previous and next as well.

By adding these two lines, and changing the second one to $current, this problem is solved. These two lines need to be added to each if and each else statement. One last thing that bugs me is the dotted border around the links. This can be removed with a simple CSS statement added to your style sheet.