-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2ab2d55
Showing
8 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
mona_lisa = "MonaLisa.jpg"; | ||
starry_night = "StarryNight.jpg"; | ||
scream = "Scream.jpg"; | ||
guernica = "Guernica.jpg"; | ||
persistence_memory = "PersistenceMemory.jpg"; | ||
|
||
var GalleryList = new Array ( | ||
new Art("Mona Lisa", 830, mona_lisa, "0"), | ||
new Art("Starry Night", 100, starry_night, "1"), | ||
new Art("The Scream", 120, scream, "2"), | ||
new Art("Guernica", 200, guernica, "3"), | ||
new Art("The Persistence of Memory", 550, persistence_memory, "4")); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Works of Art</title> | ||
<style type="text/css"> | ||
img { | ||
border: 1px solid #ddd; | ||
border-radius: 4px; | ||
padding: 5px; | ||
margin: 10px; | ||
display: inline-block; | ||
} | ||
</style> | ||
</head> | ||
|
||
<script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> | ||
<script language="javascript" src="artObject.js"></script> | ||
<script language="javascript" src="GalleryList.js"></script> | ||
|
||
<body> | ||
<h2 style='padding:5px 5px;'>Homework 6 <br> Max Ramer <br> 10/22/19 <hr> </h2> | ||
</body> | ||
|
||
<script language="javascript"> | ||
buildGallery(GalleryList); | ||
$(document).ready(function() { | ||
for (i = 0; i < GalleryList.length; i++) { | ||
$("#" + GalleryList[i].id).mouseenter(function() { | ||
$("#preview").hide(); | ||
$("#preview").html("<img src='" + this.src + "' name='" + this.name + "Big' id='" + this.id + "' width='40%' height='40%'>"); | ||
$("#preview").fadeIn(300); | ||
}); | ||
$(".galleryItem").click(function() { | ||
$("#info").html("<h3 style='text-align:center'>Title: " + this.name + "<br> Price: $" + GalleryList[this.id].price + " million</h3>"); | ||
setTimeout(function() { | ||
$("#info").html(" "); | ||
},5000); | ||
|
||
}); | ||
$("#" + GalleryList[i].id).mouseout(function() { | ||
$("#preview").hide(); | ||
}); | ||
} | ||
}); | ||
</script> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
function Art(name, price, src, id) | ||
{ | ||
this.name = name; | ||
this.price = price; | ||
this.src = src; | ||
this.id = id; | ||
} | ||
|
||
function getPrice() | ||
{ | ||
return this.price; | ||
} | ||
|
||
function buildGallery(list) | ||
{ | ||
document.write("<div id='info'> </div>"); | ||
for (i = 0; i < list.length; i++) { | ||
document.write("<img src='" + list[i].src + "' name='" + list[i].name + "' id='" + list[i].id + "' class='galleryItem' width='10%' height='10%'>"); | ||
} | ||
document.write("<div id='preview'> </div>"); | ||
} |