main.ejs 2.89 KB
<!DOCTYPE html>
<html>
<head>
<title>Facebook Login JavaScript Example</title>
<meta charset="UTF-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>

<style>
body {
  font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  padding: 20px 50px 150px;
  font-size: 13px;
  text-align: center;
  background: #E3CAA1;
}

ul {
  text-align: left;
  display: inline;
  margin: 0;
  padding: 15px 4px 17px 0;
  list-style: none;
  -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
  -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
}
ul li {
  font: bold 12px/18px sans-serif;
  display: inline-block;
  margin-right: -4px;
  position: relative;
  padding: 15px 20px;
  background: #fff;
  cursor: pointer;
  -webkit-transition: all 0.2s;
  -moz-transition: all 0.2s;
  -ms-transition: all 0.2s;
  -o-transition: all 0.2s;
  transition: all 0.2s;
}
ul li:hover {
  background: #555;
  color: #fff;
}
ul li ul {
  padding: 0;
  position: absolute;
  top: 48px;
  left: 0;
  width: 150px;
  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;
  display: none;
  opacity: 0;
  visibility: hidden;
  -webkit-transiton: opacity 0.2s;
  -moz-transition: opacity 0.2s;
  -ms-transition: opacity 0.2s;
  -o-transition: opacity 0.2s;
  -transition: opacity 0.2s;
}
ul li ul li {
  background: #555;
  display: block;
  color: #fff;
  text-shadow: 0 -1px 0 #000;
}
ul li ul li:hover { background: #666; }
ul li:hover ul {
  display: block;
  opacity: 1;
  visibility: visible;
}
</style>
<script>
$(function () {
  $('.click_genre').click(function () {
      var str = $(this).text();
      var search = $("#search_input").val();
      $.ajax({
              type:"GET",
              url:"serach",
              data:{'genre':str, 'search':search},
              success:function(args){
                $('#info').html(args);
                  //alert(args);
              },
          });
  })
})
</script>

<body>

<input type="text" id = "search_input"></input>
<br>
  <ul>
    <li>
      Genre
      <ul>
        <li class = "click_genre" >Action</li>
        <li class = "click_genre" >Romance</li>
        <li class = "click_genre">Horror</li>
        <li class = "click_genre">Drama</li>
        <li class = "click_genre">Fantasy</li>
        <li class = "click_genre">Adventure</li>
        <li class = "click_genre">Thriller</li>
        <li class = "click_genre">Comedy</li>
        <li class = "click_genre">War</li>
      </ul>
    </li>

    <li>
      Rating
      <ul>
        <li>3.0 Above</li>
        <li>3.5 Above</li>
        <li>4.0 Above</li>
        <li>4.5 Above</li>
      </ul>
    </li>

    <li>
      Portfolio
      <ul>
        <li>Web Design</li>
        <li>Web Development</li>
        <li>Illustrations</li>
      </ul>
    </li>
    <li>Blog</li>
    <li>All</li>
  </ul>

  <div id = info></div>
</body>
</html>