-
Notifications
You must be signed in to change notification settings - Fork 0
/
flip.js
30 lines (30 loc) · 869 Bytes
/
flip.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
$(function()
{
$("#home").hide();
$("#swap").on("click", function(e)
{
$("#home").toggle();
$("#container").toggleClass("flipped");
});
$("iframe").on("load", function()
{
$contents = $("iframe").contents();
$contents.find("#google").on("click", function()
{
$("#frame").attr("src", "http://www.google.fi/custom?q=" + $contents.find("#googlequery").val());
});
$contents.find("#wikipedia").click(function()
{
$("#frame").attr("src", "http://fi.wikipedia.org/w/index.php?search=" + escape($contents.find("#wikipediaquery").val()));
});
});
$("#home").on("click", function()
{
$("#frame").attr("src", "search.html");
});
$(window).on("resize", function()
{
$(".camera").css({top: $(window).height()-$(".camera").outerHeight()>>1 + "px"});
});
$(".camera").css({top: $(window).height()-$(".camera").outerHeight()>>1 + "px"});
});