umar « Intelligrape Groovy & Grails Blogs
Subscribe via E-Mail:

umar

http://www.intelligrape.com

CSS/CSS3 and XHTML/HTML developer, HTML5 Developer, jQuery Worshiper

Posts by umar:

  • Configuration of ElasticSearch on windows machine

    19 Sep 2012 in System

    Hi,
    I try to find the installation process for elasticSearch, but didn’t get a right way to install, after along search on google i got below link:

    http://pastorcmentarny.blogspot.in/2011/09/how-to-install-elasticsearch-on-windows.html looked helpful but still very tricky and a lot of effort

    Recently in my project, I got stuck while installing elasticsearch plugin on windows machine.
    ElasticSearch is built using Java setting the JAVA_HOME environment variable.

    1. Download the elasticsearch installer latest version from https://github.com/rgl/elasticsearch-setup/downloads/elasticsearch-0.19.2-setup-64-bit.exe

    To run elastic, execute file : C:\Program Files\elasticsearch\bin\elasticsearch.bat
    But you can easily convert it into a service that runs on startup
    2. Set the PATH environment variable

    PATH  = C:\Program Files\elasticsearch\bin\elasticsearch.bat
    
  • Placeholder in html5

    HTML5 has made the page designing an easy task. Placeholder is input field improvement in html5. Things that we were doing in past using combination of HTML and client side scripting language can be done in HTML5 using an attribute. One of the example is placeholder attribute used with input type text which automatically puts the placeholder attribute value in the text field if it is empty. This placeholder text is cleared automatically on focus and on focus out either the entered text or the placeholder value (if nothing was entered) is displayed.

    html form

    <form>
    <code>
      <input name="fieldname" placeholder="Enter any keyword">
      <input type="submit" value="Search">
    </code>
    </form>
    

    Support browser

    IE Firefox Safari Chrome Opera
    . 3.7+ 4.0+ 4.0+ 11.0+
  • Change Input Type auto focus

    This is little bit but it is very useful. This is input type equalto text when when cursor come in input then change type equalto password.

    Embed in html

    <input type="text" onblur="javascript:if(this.value==''){this.value='password',this.type='text'} else {this.type='password'}" onfocus="javascript:if(this.value=='password'){this.value=''} {this.type='password'}" value="password" tabindex="1" size="30" id="txtEmail" name="txtEmail">
    

    This is Demo





    Support browser

    IE Firefox Safari Chrome Opera
    6.0+ 3.5+ 3.0+ 3.0+ 10.5+
  • Audio html5

    16 Jan 2011 in HTML-UI-CSS

    Audio tag is a html 5 element. You can play audio file on web page without any third party plug-in. This will work only on html5 compliant browser.

    Flash player is widely used to play audio and video files on web. There are some third party plug-ins likes Flash Player, QuickTime, Real Player etc available for this. The main disadvantage of Third party plug-ins is that we need to download client side browser.

    Audio tag is embeded in HTML:

    <audio src="audio.ogg" controls="controls">
    Your browser does not support the audio element.
    </audio>
    

    Use Attribute in audio tag

    Attribute Value Description
    autoplay autoplay The start playing audio.
    controls controls Controls is display as a play
    button.
    loop loop The audio will start over again, whenis finished.
    preload auto
    metadata
    none
    Audio should be loaded when the page
    loads.
    src url Defines the URL of the audio to play

    Support browser

    Browser
    FireFox 3.6+
    Safari 5+
    Chrome 6
    Opera 10.5+
    IE 9(beta)



    Umar Pahat
    Umar [at] intelligrape [dot] comAudio tag is a html 5 element. You can play audio file on web page without any third party plug-in. This we work only on html5 compliant browser support.

  • Local Storage (html5)

    14 Dec 2010 in HTML-UI-CSS

    HTML5 storage provides a way for web sites to store information on your computer and retrieve it later. The concept is similar to cookies, but cookies do not store larger quantities of data. Cookies are limited in size, and your browser sends request to the web server every time a new request is initiated (which takes extra time and bandwidth). HTML5 storage stays on your computer, and web sites can access it with JavaScript after the page is loaded.

    Detection browser technique -

         function supports_local_storage() {
      try {
        return 'localStorage' in window && window['localStorage'] !== null;
      } catch(e){
        return false;
      }
    }
    

    If your browser supports HTML5 storage, there will be a localStorage property on the global window object. If your browser doesn’t support HTML5 storage, the localStorage property will be undefined. Add this modernizr.js file and use this function:

    if (Modernizr.localstorage) {
      // window.localStorage is available!
    } else {
    
      // maybe try Gears or another third-party solution
    }
    

    Note that JavaScript is case-sensitive. The Modernizr attribute is called localstorage (all lowercase), but the DOM property is called window.localStorage

    Umar !
    umar@intelligrape.com

  • clearfix css hack

    13 Nov 2010 in HTML-UI-CSS

    The clearfix hack, or “easy-clearing” hack, is a useful method of clearing float(left, right) effort. The clearfix hack works great, but the browsers that it targets are either obsolete or well on their way. Specifically, Internet Explorer 5 for Mac is now history, so there is no reason to bother with it when using the clearfix method of clearing floats.

    When the container not wrapping floated divs within it.clearfix hack (which includes the guillotine bug for IE etc). It fixes the problem.


    Definition and Usage
    This code define in css

    /* new clearfix */ .clearfix:after { visibility: hidden; display: block; font-size: 0; content: " "; clear: both; height: 0; } * html .clearfix { zoom: 1; } /* IE6 */ *:first-child+html .clearfix { zoom: 1; } /* IE7 */

    Tips and Notes
    Add class in html code

    Class=”clearfix”

    I happens most often (or is most noticeable) when you’ve got a design that wants to go flush to the bottom of the browser. However, for some damn reason, it just won’t go flush — it is that pesky five or so pixels that just won’t budge. Playing with the padding and margins don’t help — what could it be? Check the containing element and see if you’ve applied the clearfix css hack to it … because if you did, our money is that is your problem.

    There are many variations of clearfix floating around the web.The clearfix method applies clearing rules to standards-compliant browsers using the :after pseudo-class. For IE6 and IE7, This clearfix method triggers has Layout with some proprietary CSS. Thus Clearfix method effectively clears floats in all currently used browsers without using any hacks.

    Support browser

    IE Firefox Safari Chrome Opera iPhone Android
    6.0+ 3.5+ 3.0+ 3.0+ 10.5+ 1.0+ 2.0+
  • Video Tag in HTML 5

    14 Oct 2010 in Grails

    Video define new element in html 5. video play without third party plugins as Apple Quict Time and Adobe Flash player.The video element is dectect to be usable without any detection script.
    You can specify multi video file and browser that support html 5 video use choose the base on what video format they support.
    this use tag in html

    <video src="movie.ogg" controls="controls">

    your browser does not support the video tag

    </video>

    Definition and Usage
    The video tag defines video, such as a movie clip or other video streams.

    Tips and Notes
    You can write text between the start and end tags, to show older browser that they do not support this tag.

    Optional Attributes

    Attribute Value Description
    autoplay autoplay If present, then the video will start playing as soon as it is ready
    controls controls If present, controls will be displayed, such as a play button.
    height height Sets the height of the video player
    loop loop If present, the video will start over again, every time it is finished.
    preload preload If present, the video will be loaded at page load, and ready to run. Ignored if "autoplay" is present.
    src url The URL of the video to play
    width pixel Sets the width of the video player

    Support browser

    IE Firefox Safari Chrome Opera iPhone Android
    9.0+ 3.5+ 3.0+ 3.0+ 10.5+ 1.0+ 2.0+
  • canvas

    07 Sep 2010 in HTML-UI-CSS

    The HTML <canvas> tag is used for creating graphics on the fly. It can be used for rendering graphs, game graphics, or other visual images.

     

    To draw on the canvas, the <canvas> tag is used in conjunction with the getContext(contextId) method.

     

    Any content between the <canvas></canvas> tags is “fallback content”- meaning, it will be displayed only if the canvas cannot be displayed.

     

    As a script:

    function displayCanvas()
    	{
          var canvas = document.getElementById("myCanvas");
          if (canvas.getContext) {
            var ctx = canvas.getContext("2d");
    
            ctx.fillStyle = "rgb(200,0,0)";
            ctx.fillRect (0, 0, 150, 75);
    
            ctx.fillStyle = "rgba(0, 0, 200, 0.5)";
            ctx.fillRect (40, 30, 125, 75);
    
            ctx.fillStyle = "rgb(0,0,150)";
            ctx.strokeRect (20, 20, 50, 100);
          }
        }

     

    and this is html

    <canvas id="myCanvas" width="300" height="200">Your browser does not support the canvas tag. At the time of writing, Firefox, Opera, and Chrome support this tag.
    
    Here's an image of what it's supposed to look like image.
    </canvas>

    Attributes
    width: {Specifies the canvas width in pixels. The default value is 300.Possible values:[Non-negative integer] (for example, 300)}
    Height: {Specifies the canvas height in pixels. The default value is 150.Possible values:[Non-negative integer] (for example, 150)}

  • Images rotation and div rotation by CSS Transforms

    13 Aug 2010 in Grails

    The CSS transform property allows developers to rotate, scale, and skew blocks of HTML via CSS. Although you can do the same thing with images in Photoshop or The GIMP, using CSS transforms allows developers to do the same thing with any HTML markup and allows users to select the text within the transformed object.

    I saw the design potential of using CSS transforms and was frustrated at Explorer’s lack of support. I originally tried a non-JavaScript solution which involved creating CSS rules that combine transform with an IE technology that does something similar:

    the syntax of transform is very obvious:

    #myObject {
       transform: rotate(40deg) scale(2.0);
    }

    but the IE filter code is quite intimidating:

    #myObject {
       filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand',
            M11=1.5320888862379554, M12=-1.2855752193730787,
            M21=1.2855752193730796, M22=1.5320888862379558);
    }

    The scary numbers that the DXImageTransform.Microsoft.Matrix filter uses requires knowledge of matrix and vector mathematics. Even the mathematically gifted wouldn’t want to do the calculations to do a simple rotate in CSS .

    although it is possible to have a list of transformations using transform, the DXImageTransform.Microsoft.Matrix filter only allows one transform matrix. In order to implement multiple transforms using one filter, a designer would have to convert all the transforms into matrices and multiply them together.

    when rotating, skewing, or doing any other transformations on objects using the transform property.
    ##Umar Pahat##
    umar@intelligrape.com
    www.intelligrape.com

  • Rounded corner and CSS3 Gradient with border

    First download these files:
    http://code.jquery.com/jquery-1.4.2.min.js
    http://codelab.jomvideo.com/javascript/curvycorners-2.1-BETA/curvycorners.src.js

    You can round corner DIV, LI tags and others
    You add a class where you want round corner

    Add this CSS:

    .cornerBox ul li.corner{zoom:1;border:0;filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#1f858f',EndColorstr='#329ba6');background:-webkit-gradient(linear, left top, left bottom, from(#1f858f), to(#329ba6));background:-moz-linear-gradient(top, #1f858f, #329ba6);background:#1f858f;}
    .cornerBox ul div.outer {background:#fff;padding:0;margin-top:15px;}

    Add this jQuery code:

     $(function(){
    		 $('.corner').wrap('
     
    ');
    		$('.corner').corner("round 3px").parent().css('padding', '1px').corner("round 3px")
    		    });

    Hope this helps !!

    Umar Pahat
    umar@intelligrape.com

    http://www.intelligrape.com