Tuesday, November 27, 2012

Add Pin It Button to your site


Add Want Button to your site

Use script
<script>
(function() {
        var _w = document.createElement("script"); _w.type = "text/javascript"; _w.async = true;
        _w.src = "http://button.wanttt.com/button/script/";
        var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(_w, s);
})();
</script>
<a href="http://wanttt.com/want/initial_popup/"
data-merchant_name="ESCAPED_MERCHANT_NAME"
data-title="ESCAPED_PRODUCT_NAME"
data-price="PRODUCT_PRICE"
data-image_url="HIGH_RESOLUTION_PRODUCT_IMAGE_URL"
data-count="true"
data-style="wb1" data-page_source="PRODUCT" class="wantButton"></a>
 
 
or go to http://wantbutton.com/code.html

Tuesday, November 6, 2012

show plain text in a password field and then make it a regular password field on focus

Use html as
<input type="text" value="password" id="password">

And use script 
jQuery( document ).ready( function(){

    jQuery( document ).delegate( "#password", "focusin focusout",
        function(e){
        var elm = jQuery( "#password" )[0];
            if( e.type == "focusin" && elm.type == "text" ) {
            jQuery( elm ).replaceWith( jQuery( "<input>", {id: "password", type:"password", value:"" } ) );
            jQuery( "#password")[0].focus();
            }
            else if( e.type =="focusout" && elm.type == "password" && !elm.value ) {
                jQuery( elm ).replaceWith( jQuery( "<input>", {id: "password", type:"text", value:"password" } ) );
            }
        
        }
    );
});