GithubHelp home page GithubHelp logo

whundahl / csci215_lab_08 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from csci-215-websiteprogramming/csci215_lab_08

0.0 1.0 0.0 1.93 MB

jQuery Effects and Animation

HTML 25.37% CSS 74.63%

csci215_lab_08's Introduction

Lab_08

jQuery Effects and Animation

Part 1, One-Page FAQ

  • When a question is clicked, the corresponding answer will appear.
  • When a question whose answer is visible is clicked, then the answer should disappear.
  • Read and follow instructions in faqLab.pdf.

Part 2, Login Slider

  • Select the paragraph with the "Login" message in it.
  • Attach a click event handler to that paragraph.
  • Toggle the display of the form on and off.
  • Read and follow the instructions in sliderLab.pdf.

Part 3, Animated Dashboard

  • Select the <div> tag.
  • Attach a hover event.
  • Add the animate function for the mouseEnter event.
  • Add another animate function for the mouseLeave event.
  • Read and follow the instructions in animateLab.pdf.

NOTES:

jQuery Effects

Making elements on a web page appear and disappear is a common JavaScript task such as drop-down navigation menus, pop-up tooltips, and automated slideshows. jQuery supplies a few functions to make this easier.

$('.submenu').hide() would hide all of the tags with a class of submenu.

Each effect function also can take in an optional speed and a callback function.

  • speed represents the amount of time the effect takes to complete
    • can be fast, normal, slow or a number of milliseconds
    • $('element').fadeOut('slow');
  • callback is a function that runs when the effect is finished

Basic Showing and Handling

jQuery provides three functions for basic hiding and showing of elements:

  • show() - makes a hidden element visible
  • hide() - hides a visible element
  • toggle() - switches the current display value

Fading Elements In and Out

For more dramatic effect, you can fade elements in or out

  • fadeIn() - makes hidden element fade into view
  • fadeOut() - hides a visible element by making it fade out of view
  • fadeToggle() - combines both fadeIn() and fadeOut()
  • fadeTo() - fades and image to a specific opacity. Must provide a speed value
    • $('p').fadeTo('normal', .75); - fades at normal speed to .75 opacity

csci215_lab_08's People

Contributors

kabriggs991 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.