Pages

Reset CSS Link Outlines

CSS code to remove outline effect in web page links

a {
   outline: 0;
}
a:hover, a:active, a:focus {
  outline: 0;
}

JQuery if else on hover

CSS styles change on hover state with JQuery if else statement

    $(document).ready(function() {

        $('body').mouseover(function() {

            if ($('.comsec1').is(':hover')) {
                            $('.comsec2').css('width','40%');
           $('.comsec1').css('width','60%');
            }
            
            else if ($('.comsec2').is(':hover')) {
                          $('.comsec2').css('width','60%');
           $('.comsec1').css('width','40%');
            }
            
            else  {
            $('.comsec2').css('width','50%');
            $('.comsec1').css('width','50%');
            }

        });
        
    });

JQuery select the clicked class

Here is a JQuery code snippet  to get the clicked div elements's attribute or the value with the similar class names on click function

<script>

$(document).ready(function(){
    $('.simg').click(function(){
        //var pth = $('.simg').attr('src');
        
        var pth = $(this).attr('src');
        
        console.log(pth);
    });    
});

</script>

JQuery select the clicked class

Web Designer color palette 2015

Recomended Web designer color palette for 2015

Web Designer color palette 2015

Colors used by Google.com for the Olympic games


JQuery Detect the browser window top and change CSS on page

JQuery Detect the browser window top and change CSS on page

 var t = $("#nav2").offset().top;

    $(document).scroll(function() {
        if ($(this).scrollTop() > t)
        {
            $('#nav2').css('position', 'fixed');
            $('#nav2').css('top', '0');
        }
        else
        {
            $('#nav2').css('position', 'relative');
        }
    });

Search This Blog