Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //login check
- $(document).ready(function(){
- $("#login").click(function(){
- username=$("#username").val();
- password=$("#password").val();
- $.ajax({
- type: "POST",
- url: "logincheck.php",
- data: "cell="+username+"&passw="+password,
- success: function(html){
- if(html=='true')
- {
- var time_left = 5;
- var cinterval;
- function time_dec(){
- time_left--;
- document.getElementById('countdown').innerHTML = time_left;
- if(time_left == 0){
- clearInterval(cinterval);
- }
- }
- cinterval = setInterval('time_dec()', 1000);
- var a = "<?PHP $sitelink/home.php?>";
- function redirect(){
- window.location = "home.php";
- }
- setTimeout(redirect, 3000);
- $("#add_err").html("Welcome "+username+"! Redirecting in 3 Second!");
- }
- else
- {
- $("#add_err").html("Wrong Password!");
- }
- },
- beforeSend:function()
- {
- $("#add_err").html("Loading...")
- }
- });
- return false;
- });
- });
- //Search Auto Complete
- $(function(){
- $(".search").keyup(function()
- {
- var inputSearch = $(this).val();
- var dataString = 'q='+ inputSearch;
- if(inputSearch!='')
- {
- $.ajax({
- type: "GET",
- url: "http://local.con/critic/assets/files/ajaxsearch.php",
- data: dataString,
- cache: false,
- success: function(html)
- {
- $("#divResult").html(html).show();
- }
- });
- }return false;
- });
- jQuery("#divResult").live("click",function(e){
- var $clicked = $(e.target);
- var $name = $clicked.find('.name').html();
- var decoded = $("<div/>").html($name).text();
- $('#inputSearch').val(decoded);
- });
- jQuery(document).live("click", function(e) {
- var $clicked = $(e.target);
- if (! $clicked.hasClass("search")){
- jQuery("#divResult").fadeOut();
- }
- });
- $('#inputSearch').click(function(){
- jQuery("#divResult").fadeIn();
- });
- });
- //Search Auto Complete
- //style search
- $(function(){
- var input = $('input#inputSearch');
- var divInput = $('div.input');
- var width = divInput.width();
- var outerWidth = divInput.parent().width() - (divInput.outerWidth() - width);
- var submit = $('#searchSubmit');
- var txt = input.val();
- input.bind('focus', function() {
- if(input.val() === txt) {
- input.val('');
- }
- $(this).animate({color: '#000'}, 300); // text color
- $(this).parent().animate({
- width: outerWidth + 'px',
- backgroundColor: '#fff', // background color
- paddingRight: '43px'
- }, 300, function() {
- if(!(input.val() === '' || input.val() === txt)) {
- if(!($.browser.msie && $.browser.version < 9)) {
- submit.fadeIn(300);
- } else {
- submit.css({display: 'block'});
- }
- }
- }).addClass('focus');
- }).bind('blur', function() {
- $(this).animate({color: '#b4bdc4'}, 300); // text color
- $(this).parent().animate({
- width: width + 'px',
- backgroundColor: '#e8edf1', // background color
- paddingRight: '15px'
- }, 300, function() {
- if(input.val() === '') {
- input.val(txt)
- }
- }).removeClass('focus');
- if(!($.browser.msie && $.browser.version < 9)) {
- submit.fadeOut(100);
- } else {
- submit.css({display: 'none'});
- }
- }).keyup(function() {
- if(input.val() === '') {
- if(!($.browser.msie && $.browser.version < 9)) {
- submit.fadeOut(300);
- } else {
- submit.css({display: 'none'});
- }
- } else {
- if(!($.browser.msie && $.browser.version < 9)) {
- submit.fadeIn(300);
- } else {
- submit.css({display: 'block'});
- }
- }
- });
- });
- //SCROLLING SIDEBAR
- $(document).ready(function() {
- $.lockfixed("#sidebar .css3transition",{offset: {top: 30, bottom: 100}});
- $});
- //LAZYLOAD
- $(function() {
- $("img.lazy").lazyload({
- effect : "fadeIn"
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement