August 1, 2013

Custom HTML Select Box

Add Jquery and call this id on your select box id="Items" in your page than call this script:========

jQuery.fn.extend({
    selectbox: function(options) {
        return this.each(function() {
            new jQuery.SelectBox(this, options);
        });
    }
});


/* For ie logging */
if (!window.console) {
    var console = {
        log: function(msg) {
     }
    }
}
/* */

jQuery.SelectBox = function(selectobj, options) {
   
    var opt = options || {};
    opt.inputClass = opt.inputClass || "selectbox";
    opt.containerClass = opt.containerClass || "selectbox-wrapper";
    opt.hoverClass = opt.hoverClass || "current";
    opt.currentClass = opt.selectedClass || "selected"
    opt.debug = opt.debug || false;
   
    var elm_id = selectobj.id;
    var active = -1;
    var inFocus = false;
    var hasfocus = 0;
    //jquery object for select element
    var $select = $(selectobj);
    // jquery container object
    var $container = setupContainer(opt);
    //jquery input object
    var $input = setupInput(opt);
    // hide select and append newly created elements
    $select.hide().before($input).before($container);
   
   
    init();
   
    $input
    .click(function(){
    if (!inFocus) {
          $container.toggle();
        }
    })
    .focus(function(){
       if ($container.not(':visible')) {
           inFocus = true;
           $container.show();
       }
    })
    .keydown(function(event) {      
        switch(event.keyCode) {
            case 38: // up
                event.preventDefault();
                moveSelect(-1);
                break;
            case 40: // down
                event.preventDefault();
                moveSelect(1);
                break;
            //case 9:  // tab
            case 13: // return
                event.preventDefault(); // seems not working in mac !
                $('li.'+opt.hoverClass).trigger('click');
                break;
            case 27: //escape
              hideMe();
              break;
        }
    })
    .blur(function() {
        if ($container.is(':visible') && hasfocus > 0 ) {
            if(opt.debug) console.log('container visible and has focus')
        } else {
            hideMe();   
        }
    });


    function hideMe() {
        hasfocus = 0;
        $container.hide();
    }
   
    function init() {
        $container.append(getSelectOptions($input.attr('id'))).hide();
        var width = $input.css('width');
        $container.width(width);
    }
   
    function setupContainer(options) {
        var container = document.createElement("div");
        $container = $(container);
        $container.attr('id', elm_id+'_container');
        $container.addClass(options.containerClass);
       
        return $container;
    }
   
    function setupInput(options) {
        var input = document.createElement("input");
        var $input = $(input);
        $input.attr("id", elm_id+"_input");
        $input.attr("type", "text");
        $input.addClass(options.inputClass);
        $input.attr("autocomplete", "off");
        $input.attr("readonly", "readonly");
        $input.attr("tabIndex", $select.attr("tabindex")); // "I" capital is important for ie
       
        return $input;   
    }
   
    function moveSelect(step) {
        var lis = $("li", $container);
        if (!lis) return;

        active += step;

        if (active < 0) {
            active = 0;
        } else if (active >= lis.size()) {
            active = lis.size() - 1;
        }

        lis.removeClass(opt.hoverClass);

        $(lis[active]).addClass(opt.hoverClass);
    }
   
    function setCurrent() {   
        var li = $("li."+opt.currentClass, $container).get(0);
        var ar = (''+li.id).split('_');
        var el = ar[ar.length-1];
        $select.val(el);
        $input.val($(li).html());
        return true;
    }
   
    // select value
    function getCurrentSelected() {
        return $select.val();
    }
   
    // input value
    function getCurrentValue() {
        return $input.val();
    }
   
    function getSelectOptions(parentid) {
        var select_options = new Array();
        var ul = document.createElement('ul');
        $select.children('option').each(function() {
            var li = document.createElement('li');
            li.setAttribute('id', parentid + '_' + $(this).val());
            li.innerHTML = $(this).html();
            if ($(this).is(':selected')) {
                $input.val($(this).html());
                $(li).addClass(opt.currentClass);
            }
            ul.appendChild(li);
            $(li)
            .mouseover(function(event) {
                hasfocus = 1;
                if (opt.debug) console.log('over on : '+this.id);
                jQuery(event.target, $container).addClass(opt.hoverClass);
            })
            .mouseout(function(event) {
                hasfocus = -1;
                if (opt.debug) console.log('out on : '+this.id);
                jQuery(event.target, $container).removeClass(opt.hoverClass);
            })
            .click(function(event) {
              var fl = $('li.'+opt.hoverClass, $container).get(0);
                if (opt.debug) console.log('click on :'+this.id);
                $('li.'+opt.currentClass).removeClass(opt.currentClass);
                $(this).addClass(opt.currentClass);
                setCurrent();
                hideMe();
            });
        });
        return ul;
    }
   
};

July 24, 2013

Google Vs Yahoo

  1. Google Alerts (beta):Google Alerts are email updates of the latest relevant Google results (web, news, etc.) based on your choice of query or topic.
    Yahoo! Alerts Get real-time updates delivered to you instantly via: email, mobile device, or Yahoo! Messenger.
  2. Answers:
    Google Answers Google Answers is a way to get that help from Researchers with expertise in online searching.
    Ask Yahoo! We carefully research our answers by searching the Internet for relevant web sites and pages.
  3. Desktop Search:Google Desktop Find your email, files, media, web history and chats instantly.
    Yahoo! Desktop Search (beta) Yahoo! Desktop Search Beta is a free, downloadable search application that enables you to find any of your files, emails, attachments, instant messages and contacts.
  4. Directory:
    Google Directory The Google Web Directory integrates Google's sophisticated search technology with Open Directory pages to create the most useful tool for finding information on the web.
    Yahoo! Directory The Yahoo! Directory gives you access to what's available on the Web.
  5. Finance:
    Google Search Feature: Stocks To use Google to get live stock quotes and information, just enter one or more ticker symbols.
    Yahoo! Finance You have access to a wide array of financial resources on Yahoo!
  6. Groups:
    Google Groups (beta) A Google Group is an online discussion group or mailing list that helps groups of people communicate using email and the web.
    Yahoo! Groups Yahoo! Groups is a free service that allows you to bring together family, friends, and associates through a web site and email group.
  7. Image Search:
    Google Image Search Google's Image Search is the most comprehensive on the Web, with more than one billion images indexed and available for viewing.
    Yahoo! Image Search Yahoo! Image Search allows you to search millions of images from across the Web.

May 21, 2013

CSS 3 Features in ie (Rounded corners, Gradients)

Here is the solution for using features of CSS3 in ie versions:
By this you can:

1. Rounded corners in ie (6,7,8,9)
2. Gradients in ie (6,7,8,9)
etc.

PIE makes Internet Explorer 6-9 capable of rendering several of the most useful CSS3 decoration features.
http://css3pie.com/

December 27, 2012

Some Big Myths About SEO:

Metatag Descriptions Help Your Rankings==
Not anymore: in fact, metatags are no longer even indexed by Google and Bing. But don't ignore them altogether: Your metatags form the text that is displayed along with your link in the search results--and a more compelling description will compel more users to click on your listing instead of on others.

The More Inbound Links, the Better==
False. In all the recent updates to Google's algorithm, the search giant has made it a core priority to have quality trump quantity. Gone are the days of having thousands of superlow-quality links driving up rankings; in fact, creating those links can look spammy and get your site penalized.

Websites must be submitted to search engines==
In 2001, yes, this was the case--indeed, this was the first service that my company, Wpromote, ever provided. But in 2012? Not at all. At this point, if there is any connection from any site to yours, your site will be quickly discovered by Google.

Note that being indexed is a far cry from achieving high rankings--but that initial step of submission is no longer needed or helpful.

November 30, 2012

Website marketing using social media

Yup. Social Media is the very big thing today, and Social Media marketing is what gets you there.

It is not just about being between the masses. It’s about communicating with the masses, by being at the right place, at the right time.

And the most important thing, its about creating your brand awareness, It's about securing positive corporate image, combati

ng the negative brand image! And hence new customers.

And that is where it's come in, it's excel in this service by using unique skills to create personal connection with the audience, on your behalf!

Following a completely natural marketing process, it's not only initiate contact with your target audience, also engage in conversations. It is with a series of Social Media like Blogs, Social Networks, Online Videos, Wikis and Online Surveys.

This makes a connection with your audience, and when we have all their attention, this convey your message and win them over for you.

November 3, 2012

Some very useful SEO Tricks


  1. The meta description is the next element you must optimize.
  2. Use
  3. Make the meta descriptions short – Google limits meta descriptions to 160 characters or less.
  4. Another big way that is attracting attention when it comes to ranking above the fold is with Google’s new authorship markup and Google+ search strategy.
  5.  Drive links to important pages:
  6. You can’t expect a page to rank above the fold if you don’t have links going to the page you want to rank.
  7. Add social sharing:
  8. Most SEO experts agree that social signals on the page level will impact search results