Sunday, January 29, 2012

Cricket World Cup 2011 Final Match Highlight

 

What a Great Inning from Indian Captain MS Dhoni... :)

Monday, January 23, 2012

Working example of the tabSlideOut jQuery plugin

See that little tab over there that says 'Contact'? If you click that it will slide out. This plugin allows you to easily add one of those to your page.

The most important part of getting this plugin to work is to have your image path and image dimensions set correctly in the options. In this version, using the code below, I am linking directly to google code for the jquery library as well as the plugin which I am hosting at code.google.com.



View Demo 
Download Files 
Download Plugin


Getting started

In your <head> tag you need the javascript (with the options customized for your image):



<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
<script src="http://tab-slide-out.googlecode.com/files/jquery.tabSlideOut.v1.3.js"></script>

    <script type="text/javascript">
    $(function(){
        $('.slide-out-div').tabSlideOut({
            tabHandle: '.handle',                     //class of the element that will become your tab
            pathToTabImage: 'images/contact_tab.gif', //path to the image for the tab //Optionally can be set using css
            imageHeight: '122px',                     //height of tab image           //Optionally can be set using css
            imageWidth: '40px',                       //width of tab image            //Optionally can be set using css
            tabLocation: 'left',                      //side of screen where tab lives, top, right, bottom, or left
            speed: 300,                               //speed of animation
            action: 'click',                          //options: 'click' or 'hover', action to trigger animation
            topPos: '200px',                          //position from the top/ use if tabLocation is left or right
            leftPos: '20px',                          //position from left/ use if tabLocation is bottom or top
            fixedPosition: false                      //options: true makes it stick(fixed position) on scroll
        });

    });

    </script>
 

Below that add your css:
 

<style type="text/css">
    .slide-out-div {
          padding: 20px;
          width: 250px;
          background: #ccc;
          border: 1px solid #29216d;
      }     
      </style>
                       

Anywhere in your page, (I put mine right above my </body>) put in the html for your hidden content.

        <div class="slide-out-div">
            <a class="handle" href="http://link-for-non-js-users.html">Content</a>
            <h3>Contact me</h3>
            <p>Thanks for checking out my jQuery plugin, I hope you find this useful.
            </p>
            <p>This can be a form to submit feedback, or contact info</p>
        </div>

       
                   

jQuery UI Tabs with Next/Previous

Tabbed areas are lovely, but when you start getting to more than 3 or 4 different tabs, they start to get a little crowded and it makes sense to provide alternative navigation of them. I think it makes sense to supply universally located Next/Previous buttons, so without even moving your cursor you can click through each of them.
View Demo   Download Files


jQuery UI makes creating tabbed areas very easy, so the framework is based on that. But we are on our own as far as Next/Previous buttons. Fortunately, jQuery UI tabs do have a function-thing that can be called to switch tabs. We can bind it to text links to accomplish switching tabs:


$('#my-text-link').click(function() { // bind click event to link
    $tabs.tabs('select', 2); // switch to third tab
    return false;
});



But we want to do this (hopefully) as smart-ly as we can. So we want to:

  1.     Add the links dynamically to each panel. If a panel is added or removed, the Next/Previous buttons  automatically adjust to the new flow. Plus, links won't be there awkwardly with JavaScript disabled
  2.     Make sure there is no "Previous" button on the first panel
  3.     Make sure there is no "Next" button on the last panel
This is how I did it:

$(function() {

        var $tabs = $('#tabs').tabs();

        $(".ui-tabs-panel").each(function(i){

          var totalSize = $(".ui-tabs-panel").size() - 1;

          if (i != totalSize) {
              next = i + 2;
                  $(this).append("<a href='#' class='next-tab mover' rel='" + next + "'>Next Page &#187;</a>");
          }

          if (i != 0) {
              prev = i;
                  $(this).append("<a href='#' class='prev-tab mover' rel='" + prev + "'>&#171; Prev Page</a>");
          }

        });

        $('.next-tab, .prev-tab').click(function() {
           $tabs.tabs('select', $(this).attr("rel"));
           return false;
       });

});

Thursday, January 19, 2012

काँच की बरनी और दो कप चाय

जीवन में जब सब कुछ एक साथ और जल्दी - जल्दी करने की इच्छा होती है , सब कुछ तेजी से पा लेने की इच्छा होती है , और हमें लगने लगता है कि दिन के चौबीस घंटे भी कम पड़ते हैं , उस समय ये बोध कथा , " काँच की बरनी और दो कप चाय " हमें याद आती है ।
दर्शनशास्त्र के एक प्रोफ़ेसर कक्षा में आये और उन्होंने छात्रों से कहा कि वे आज जीवन का एक महत्वपूर्ण पाठ पढाने वाले हैं ...
उन्होंने अपने साथ लाई एक काँच की बडी़ बरनी ( जार ) टेबल पर रखा और उसमें टेबल टेनिस की गेंदें डालने लगे और तब तक डालते रहे जब तक कि उसमें एक भी गेंद समाने की जगह नहीं बची ... उन्होंने छात्रों से पूछा - क्या बरनी पूरी भर गई ? हाँ ... आवाज आई ... फ़िर प्रोफ़ेसर साहब ने छोटे - छोटे कंकर उसमें भरने शुरु किये h धीरे - धीरे बरनी को हिलाया तो काफ़ी सारे कंकर उसमें जहाँ जगह खाली थी , समा गये , फ़िर से प्रोफ़ेसर साहब ने पूछा , क्या अब बरनी भर गई है , छात्रों ने एक बार फ़िर हाँ ... कहा अब प्रोफ़ेसर साहब ने रेत की थैली से हौले - हौले उस बरनी में रेत डालना शुरु किया , वह रेत भी उस जार में जहाँ संभव था बैठ गई , अब छात्र अपनी नादानी पर हँसे ... फ़िर प्रोफ़ेसर साहब ने पूछा , क्यों अब तो यह बरनी पूरी भर गई ना ? हाँ .. अब तो पूरी भर गई है .. सभी ने एक स्वर में कहा .. सर ने टेबल के नीचे से चाय के दो कप निकालकर उसमें की चाय जार में डाली , चाय भी रेत के बीच स्थित थोडी़ सी जगह में सोख ली गई ...
प्रोफ़ेसर साहब ने गंभीर आवाज में समझाना शुरु किया –
इस काँच की बरनी को तुम लोग अपना जीवन समझो ....
टेबल टेनिस की गेंदें सबसे महत्वपूर्ण भाग अर्थात भगवान , परिवार , बच्चे , मित्र , स्वास्थ्य और शौक हैं ,
छोटे कंकर मतलब तुम्हारी नौकरी , कार , बडा़ मकान आदि हैं , और
रेत का मतलब और भी छोटी - छोटी बेकार सी बातें , मनमुटाव , झगडे़ है ..
अब यदि तुमने काँच की बरनी में सबसे पहले रेत भरी होती तो टेबल टेनिस की गेंदों और कंकरों के लिये जगह ही नहीं बचती , या कंकर भर दिये होते तो गेंदें नहीं भर पाते , रेत जरूर आ सकती थी ...
ठीक यही बात जीवन पर लागू होती है ... यदि तुम छोटी - छोटी बातों के पीछे पडे़ रहोगे और अपनी ऊर्जा उसमें नष्ट करोगे तो तुम्हारे पास मुख्य बातों के लिये अधिक समय नहीं रहेगा ... मन के सुख के लिये क्या जरूरी है ये तुम्हें तय करना है । अपने बच्चों के साथ खेलो , बगीचे में पानी डालो , सुबह पत्नी के साथ घूमने निकल जाओ , घर के बेकार सामान को बाहर निकाल फ़ेंको , मेडिकल चेक - अप करवाओ ... टेबल टेनिस गेंदों की फ़िक्र पहले करो , वही महत्वपूर्ण है ... पहले तय करो कि क्या जरूरी है ... बाकी सब तो रेत है ..
छात्र बडे़ ध्यान से सुन रहे थे .. अचानक एक ने पूछा , सर लेकिन आपने यह नहीं बताया कि " चाय के दो कप " क्या हैं ? प्रोफ़ेसर मुस्कुराये , बोले .. मैं सोच ही रहा था कि अभी तक ये सवाल किसी ने क्यों नहीं किया ...
इसका उत्तर यह है कि , जीवन हमें कितना ही परिपूर्ण और संतुष्ट लगे , लेकिन अपने खास मित्र के साथ दो कप चाय पीने की जगह हमेशा होनी चाहिये ।

Monday, January 16, 2012

Especially for SMOKERS........



It is never too late to quit smoking.
Within the first 20 minutes of quitting, the healing process begins....
By the end of the first day after quitting smoking, you've decreased your chances of having a heart attack.The benefits will continue to improve your health and quality of life for years.

Within 12 hours after you have your last cigarette, your body will begin to heal itself. The levels of carbon monoxide and nicotine in your system will decline rapidly, and your heart and lungs will begin to repair the damage caused by cigarette smoke.As your body begins to repair itself, instead of feeling better right away, you may feel worse for a while. It's important to understand that healing is a process­ p;it begins immediately, but it continues over time. These "withdrawal pangs" are really symptoms of the recovery process.

Immediately after quitting, many ex-smokers experience "symptoms of recovery" such as temporary weight gain caused by fluid retention, irregularity, and dry, sore gums or tongue. You may feel edgy, hungry, more tired, and more short-tempered than usual and have trouble sleeping and notice that you are coughing a lot. These symptoms are the result of your body clearing itself of nicotine, a powerful addictive chemical. Most nicotine is gone from the body in 2-3 days.

Please spread awareness among smokers to quit smoking.
SHARING is caring ;)