scripts.js 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. jQuery(function($){
  2. $.supersized({
  3. // Functionality
  4. slide_interval : 4000, // Length between transitions
  5. transition : 1, // 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
  6. transition_speed : 1000, // Speed of transition
  7. performance : 1, // 0-Normal, 1-Hybrid speed/quality, 2-Optimizes image quality, 3-Optimizes transition speed // (Only works for Firefox/IE, not Webkit)
  8. // Size & Position
  9. min_width : 0, // Min width allowed (in pixels)
  10. min_height : 0, // Min height allowed (in pixels)
  11. vertical_center : 1, // Vertically center background
  12. horizontal_center : 1, // Horizontally center background
  13. fit_always : 0, // Image will never exceed browser width or height (Ignores min. dimensions)
  14. fit_portrait : 1, // Portrait images will not exceed browser height
  15. fit_landscape : 0, // Landscape images will not exceed browser width
  16. // Components
  17. slide_links : 'blank', // Individual links for each slide (Options: false, 'num', 'name', 'blank')
  18. slides : [ // Slideshow Images
  19. {image : './static/mobapps/assets/img/backgrounds/1.jpg'},
  20. {image : './static/mobapps/assets/img/backgrounds/2.jpg'},
  21. {image : './static/mobapps/assets/img/backgrounds/3.jpg'}
  22. ]
  23. });
  24. });
  25. jQuery(document).ready(function() {
  26. $('.page-container form').submit(function(){
  27. var username = $(this).find('.username').val();
  28. var password = $(this).find('.password').val();
  29. if(username == '') {
  30. $(this).find('.error').fadeOut('fast', function(){
  31. $(this).css('top', '27px');
  32. });
  33. $(this).find('.error').fadeIn('fast', function(){
  34. $(this).parent().find('.username').focus();
  35. });
  36. return false;
  37. }
  38. if(password == '') {
  39. $(this).find('.error').fadeOut('fast', function(){
  40. $(this).css('top', '96px');
  41. });
  42. $(this).find('.error').fadeIn('fast', function(){
  43. $(this).parent().find('.password').focus();
  44. });
  45. return false;
  46. }
  47. });
  48. $('.page-container form .username, .page-container form .password').keyup(function(){
  49. $(this).parent().find('.error').fadeOut('fast');
  50. });
  51. });
  52. var h = document.documentElement.clientHeight;
  53. var content_warp_h = (h-187)/3;
  54. $(".content_warp").css('min-height',h);
  55. $(".content_warp").css('padding-top',content_warp_h);
  56. $(window).resize(function() {
  57. var h = document.documentElement.clientHeight;
  58. var content_warp_h = (h-187)/3;
  59. $(".content_warp").css('min-height',h);
  60. $(".content_warp").css('padding-top',content_warp_h);
  61. });