Quotes help make search much faster. Example: "Practice Makes Perfect"
Showing posts with label jQuery. Show all posts
Showing posts with label jQuery. Show all posts
Friday, June 7, 2013
Codeschool Sample Solution Keyup Event Handler II
$(document).ready(function() {
$("#nights").on("keyup", function() {
//var days = $(this).val();
//var pricePerDay = $(".tour").data('daily-price');
//var totalPrice = days * pricePerDay;
//$("#nights-count").text(days);
//$("#total").text(totalPrice);
$("#nights-count").text($(this).val());
$("#total").text($(this).val() * $(this).closest(".tour").data('daily-price'));
});
});
Codeschool Sample Solution Keyup Event Handler I
$(document).ready(function() {
$("#nights").on("keyup", function() {
$("#nights-count").text($(this).val());
});
});
Codeschool Sample Solution Keyup Event
$(document).ready(function() {
$("#nights").on('keyup', function(){
});
});
Codeschool Sample Solution Mouseleave
$(document).ready(function() {
$("#tour").on("click", "button", function() {
$(".photos").slideToggle();
});
$(".photos").on("mouseenter", "li", function() {
$(this).find("span").slideToggle();
});
$(".photos").on("mouseleave", "li", function() {
$(this).find("span").slideToggle();
});
});
Thursday, June 6, 2013
Codeschool Sample Solution Mouseover II
$(document).ready(function() {
$("#tour").on("click", "button", function() {
$(".photos").slideToggle();
});
$(".photos").on("mouseenter", "li", function() {
$(this).find("span").slideToggle();
});
});
Codeschool Sample Solution Mouseover I
$(document).ready(function() {
$("#tour").on('click', 'button', function() {
$(".photos").slideToggle();
});
$(".photos").on('mouseenter', 'li', function(){
});
});
Codeschool Sample Solution Slide Effect II
$(document).ready(function() {
$("#tour").on("click", "button", function() {
$(".photos").slideToggle();
});
});
Codeschool Sample Solution Slide Effect I
$(document).ready(function() {
$("#tour").on("click", "button", function() {
$('.photos').slideDown();
});
});
Codeschool Sample Solution On Load II
$(document).ready(function() {
$('#tour').on('click', 'button', function(){
alert('I was clicked!');
});
});
Codeschool Sample Solution On Load I
$(document).ready(function(){
var numPhotos = $('img').length;
alert(numPhotos);
});
Codeschool Sample Solution New Filter III
$(document).ready(function(){
$("#filters").on("click", ".on-sale", function(){
$(".highlight").removeClass();
$(".tour").filter(".on-sale").addClass("highlight");
});
$("#filters").on("click", ".featured", function(){
$(".highlight").removeClass();
$(".tour").filter(".featured").addClass("highlight");
});
});
Codeschool Sample Solution New Filter II
$(document).ready(function(){
$("#filters").on("click", ".on-sale", function(){
$(".tour").filter(".on-sale").addClass("highlight");
});
});
Codeschool Sample Solution New Filter I
$(document).ready(function(){
//Create the click handler here
$("#filters").on("click", ".on-sale", function(){
});
});
Codeschool Sample Solution Better On Handlers
$(document).ready(function(){
$(".tour").on("click","button", function(){
var tour = $(this).closest(".tour");
var discount = tour.data("discount");
var message = $("<span>Call 1-555-jquery-air for a $" + discount + "</span>");
tour.append(message);
$(this).remove();
});
});
Codeschool Sample Solution Refactoring
$(document).ready(function(){
$("button").on("click", function(){
var tour = $(this).closest(".tour");
var discount = tour.data("discount");
var message = $("<span>Call 1-555-jquery-air for a $" + discount + "</span>");
tour.append(message);
$(this).remove();
});
});
Codeschool Sample Solution Fetching Data from the DOM II
$(document).ready(function(){
$("button").on("click", function(){
var discount = $(this).closest(".tour").data("discount");
//alert(discount); //for checking
var message = $("<span>Call 1-555-jquery-air for a $"+discount+" discount</span>");
$(this).closest(".tour").append(message);
$(this).remove();
});
});
Codeschool Sample Solution Fetching Data from DOM I
$(document).ready(function(){
$('button').on('click', function(){
var message = $("<span>Call 1-555-jquery-air to book this tour</span>");
var discount = $(this).closest(".tour").data("discount");
$(this).closest(".tour").append(message);
$(this).remove();
//alert(discount); //prove that value of data is stored in var discount
});
});
Codeschool Sample Solution Relative Traversing III
$(document).ready(function(){
$(".tour").on("click", function(){
var message = $("<span>Call 1-555-jquery-air to book this tour</span>");
$(this).closest(".tour").append(message);
$(this).find(".book").remove();
});
});
Codeschool Sample Solution Traversing II
$(document).ready(function(){
$('button').on('click', function(){
var message = $("<span>Call 1-555-jquery-air to book this tour</span>");
$(this).closest("li").append(message);
$(this).remove();
});
});
Codeschool Sample Solution Relative Traversing I
$(document).ready(function(){
$("button").on("click", function(){
var message = $("<span>Call 1-555-jquery-air to book this tour</span>");
$(this).parent().append(message);
$(this).remove();
});
});
Subscribe to:
Posts (Atom)
This is an example of scrolling text using Javascript.
Popular Posts
-
//Sample Solution const gameState = {} function preload() { this.load.image('codey', 'https://s3.amazonaws.com/codecademy-...
-
//sample solution function guessNumber(number, clue) { // Prompt the user for a number using the string value of clue guess = promp...
-
//sample solution //Here is the original card object var card1 = {"suit":"clubs", "rank": 8}; //Create a...
-
#sample solution def colorful_conditions(): color = "blue" if color == "red": return "firs...
-
function checkAnswerWrongPlace(ans, realanswer){ // This method compares two input strings representing a player's guess ("an...
-
Instruction: Find the id of the flights whose distance is below average for their carrier. Sample Solution: SELECT id FROM flights AS f...
-
# note: The instructions state to use "text.txt" but an error comes up stating that the file does not exist # as a work around, ...
-
# Sample Solution # Import packages import numpy as np import pandas as pd # Read in transactions data transactions = pd.read_csv(...
-
# Sample Solution from song_data import songs import numpy as np q1 = np.quantile(songs, 0.25) #Create the variables q3 and interquarti...
-
/*sample solution for style.css*/ body > p { background: green; } p { background: yellow; }