Learn how to use jQuery at the Blog

Font Ex « visit

  • Added 7 months ago
  • 64 Lines of Code shown
  • 0 Links of Interest
http://fontex.org
This is my Source Code and I don't want to show it here
View Source Code only (as overlay)
// That code snippet belongs to Font Ex - http://fontex.org

            $(document).ready(function(){
    
                // =ORDERBY: Best
                $('a#best').click(function(){
                    $("#fonts").fadeOut(500, function() {
                        $("#fonts").load("ajax.php", {limit: 12, order: 'rating DESC', type: 'free'}, function(){
                            $("#fonts").fadeIn(500);
                        });
                    });
                    $('a#best').parent().parent().addClass('active');
                    $('a#popular').parent().parent().removeClass('active');
                    $('a#newest').parent().parent().removeClass('active');
                    return false;
                });
                //------------------------------------------
                // =ORDERBY: Popular
                $('a#popular').click(function(){
                    $("#fonts").fadeOut(500, function() {
                        $("#fonts").load("ajax.php", {limit: 12, order: 'views DESC', type: 'free'}, function(){
                            $("#fonts").fadeIn(500);
                        });
                    });
                    $('a#best').parent().parent().removeClass('active');
                    $('a#popular').parent().parent().addClass('active');
                    $('a#newest').parent().parent().removeClass('active');
                    return false;
                });
                //------------------------------------------
                // =ORDERBY: Newest
                $('a#newest').click(function(){
                    $("#fonts").fadeOut(500, function() {
                        $("#fonts").load("ajax.php", {limit: 12, order: 'id DESC', type: 'free'}, function(){
                            $("#fonts").fadeIn(500);
                        });
                    });
                    $('a#best').parent().parent().removeClass('active');
                    $('a#popular').parent().parent().removeClass('active');
                    $('a#newest').parent().parent().addClass('active');
                    return false;
                });
                //------------------------------------------
    
                $('#search').focus(function(){
                    if(this.value=='Search fonts to Download...') { this.value='' }
                });
    
                $('#search').blur(function(){
                    if(this.value=='') { this.value='Search fonts to Download...' }
                });
                
                $("ul.styles li").find("span").animate({left: "120", opacity: 0}, 1)	
                $("ul.styles li").hover(function() {
                    $(this).find("span").stop()
                    .animate({left: "140", opacity:1}, 300)
                    .css("display","block")
            
                }, function() {
                    $(this).find("span").stop()
                    .animate({left: "120", opacity: 0}, 200)
                    .css("display","none")
                    .css("left","0")
                });
                
            });