Updates from Pranav Mhapsekar RSS Toggle Comment Threads | Keyboard Shortcuts

  • Pranav Mhapsekar 7:35 pm on January 6, 2012 Permalink | Log in to leave a Comment  

    IE6 news 

    Check out the link

    http://www.bbc.co.uk/news/technology-16408850

    VN:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
     
  • Pranav Mhapsekar 6:34 pm on January 4, 2012 Permalink | Log in to leave a Comment
    Tags: , IE7,   

    IE7 vertically centering image inside a div 

    To vertically center an image inside a div tag we can use display:table-cell and vertical-align: middle as the css for the div , which will work for modern browsers.
    Lets take an example
    Suppose I have the following markup.

    imagetext

    We can apply the following css to get the image vertically as well as horizontally(text-align:center) centered
    .image {
    display: table-cell;
    height: 120px;
    text-align: center;
    vertical-align: middle;
    width: 175px;
    }

    Now to get the same effect on IE7 (since IE7 doesn’t support table-cell value for display) we can use jQuery.
    The code is given below
    jQuery(‘.ie7 .image img ‘).each(function () {
    var img_height=jQuery(this).height();
    var padding_value=(120-parseInt(img_height))/2+’px’;
    jQuery(this).css(‘padding-top’,padding_value);
    });

    This code will vetically center all images contained in the div having the class “image”
    var padding_value=(120-parseInt(img_height))/2+’px’; on this line 120 refers to the height of the div

    Note:Image dimension should be less than the “div” dimension :)

    VN:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
     
    • Pranav Mhapsekar 6:38 pm on January 4, 2012 Permalink | Log in to Reply

      • Pranav Mhapsekar 7:16 pm on January 4, 2012 Permalink | Log in to Reply

        The markup is as follows
        <div class=”image”>
        <img alt=”imagetext” src=”http://imagepath”/>
        </div>

  • Pranav Mhapsekar 11:07 pm on December 27, 2011 Permalink | Log in to leave a Comment  

    Some useful commands in UNIX 

    http://tech-queries.blogspot.com/2011/12/some-lesser-known-but-useful-unix.html

    Check out the above link.

    VN:F [1.9.17_1161]
    Rating: 0 (from 0 votes)
     
  • Pranav Mhapsekar 2:09 pm on December 19, 2011 Permalink | Log in to leave a Comment
    Tags: ,   

    overriding (!important) of css by using jQuery 

    Guys,
    If you are stuck with CSS which is having !important as a value for the property and as you must be knowing, jQuery doesn’t use !important value, and lets suppose it is a “must” thing for you to change the value through jQuery,then, you can use cssText property.

    Here is an example,
    Suppose i have a CSS statement.
    #rtp-nav-menu li ul { display: none !important; color:#000000;}
    jQuery for this is
    jQuery( ‘#rtp-nav-menu li ul ‘).css({‘cssText’: ‘display: block !important’,'color’:'#000000′});

    Remember that you give cssText property first as it overrides any style associated with the particular element.

    VN:F [1.9.17_1161]
    Rating: +2 (from 2 votes)
     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel