123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- $(function(){
- $(document).scroll(function() {
- var top = $(document).scrollTop();
- if (top == 0) {
- $("#header").css("background", "rgba(255,153,0,1)");
- $(".personal-infor").css("opacity", "1");
- } else {
- $("#header").css("background", "rgba(255,153,0,0.8)");
- $(".personal-infor").css("opacity", "0.8");
- }
- if (top != 0) {
- $(".searchbox").fadeIn(1000);
- } else {
- $(".searchbox").fadeOut(1000);
- }
-
- if (top >= 350) {
- $("#serc-index").fadeIn(1000);
- } else {
- $("#serc-index").fadeOut(1000);
- }
- if (top >= 300) {
- $(".content-left").css({
- "position": "fixed",
- "top": "80px"
- })
- } else {
- $(".content-left").css({
- "position": "static"
- })
- }
-
- });
- var userid = $.cookie("userid");
- if (userid && userid != "null" && userid != null) {
- $(".myWorkspace").attr("href","workspaces.html?"+userid);
- loginStatus();
- }
- $('.head-portrait').hover(function() {
- $(".personal-infor").stop(true, false).slideDown(500);
- }, function() {
- $(".personal-infor").stop(true, false).slideUp(500);
- });
- function synContent(type) {
- if (type == 1) {
- $("#searchContent").val($("#hsearchContent").val());
- } else {
- $("#hsearchContent").val($("#searchContent").val());
- }
- }
- $("#hsearchContent").blur(function() {
- synContent(1);
- });
- $("#searchContent").blur(function() {
- synContent(2);
- });
- var lookFor = 0;
- $("#lookFor ul li").on("click",function(){
- lookFor=$(this).index();
- console.log(lookFor);
- });
- $("#search").on("click", function() {
- var searchContent = $("#searchContent").val();
- location.href = "search.html?searchContent=" + encodeURI(searchContent)+"&lookFor=" + lookFor;
- });
- $("#searchContent").keydown(function(e){
- if(e.which==13) {
- synContent(2);
- var searchContent = $("#searchContent").val();
- console.log(searchContent);
- location.href = "search.html?searchContent=" + encodeURI(searchContent)+"&lookFor=" + lookFor;
- }
-
- })
- $("#hsearchContent").keydown(function(e){
- if(e.which==13) {
- synContent(1);
- var searchContent = $("#hsearchContent").val();
- console.log(searchContent);
- location.href = "search.html?searchContent=" + encodeURI(searchContent);
- }
- })
- $("#hsearch").on("click", function() {
- var searchContent = $("#hsearchContent").val();
- location.href = "search.html?searchContent=" + encodeURI(searchContent);
- });
- $(".field").bind("click",function(){
- location.href = "search.html?subject=" + encodeURI($(this).text());
- })
- $('.professor').hover(function() {
- $(this).find(".professor-data").stop(true, false).animate({
- "padding": "94px 0",
- "top": "-50px"
- })
- }, function() {
- $(this).find(".professor-data").stop(true, false).animate({
- "padding": "25px 0",
- "top": "58%"
- })
- })
- })
|