My Linux Stuff - Complete Blog For Linux Articles

My Linux Stuff - Complete Blog For Linux Articles

A Website For Complete Linux OS,Step by Step linux Installtion, Linux Tips and Tricks and Linux Stuff and so on... Connect and sharing here....

TOP 50 ENGINEERING COLLEGES IN INDIA 2014

TOP 50 ENGINEERING COLLEGES IN INDIA 2014

This below survey was taken many form many colleges in India. These Top 50 Engineering Colleges in India have Good Infrastructure, Good Environment, Educations , Staff, Placement , Research Activities and other Facilities are good.

Top 10 Government Engineering Colleges in India

Top 10 Government Engineering Colleges in India

These Government Engineering Colleges in India are really good for all kind of stuff like Education , research , Placement and New Innovation Ideas etc... But Getting seat in these colleges are heavy competition in students .....

Top 10 Colleges In India 2014

Top 10 Colleges In India 2014

Indian Institute Of Technology Delhi,Indian Institute Of Technology Bombay,Indian Institute Of Technology Kanpur,Indian Institute Of Technology Madras,Indian Institute Of Technology Kharagpur,Indian Institute Of Technology Roorkee,University Of Delhi,Indian Institute Of Technology Guwahati,University Of Calcutta,University Of Mumbai, National Institute Of Technology,Trichy.

2014 LATEST SURVEY TOP RANKING ENGINEERING COLLEGES IN INDIA

2014 LATEST SURVEY TOP RANKING ENGINEERING COLLEGES IN INDIA

This below survey was taken many form many colleges in India. These Top 100 Engineering Colleges in India have Good Infrastructure, Good Environment, Educations , Staff, Placement , Research Activities and other Facilities are good. If you want to do Engineering as your dream and try out these colleges

Subscribe Now!

Enter your email address:

Showing posts with label CSS3. Show all posts
Showing posts with label CSS3. Show all posts

Tuesday, November 15, 2011

simple css3 checkbox and radio button



outPut of Below Code
This simple check box and radio button can be used for iPhone, iPad, android or standard browser based application.  Here we use css3 border-radius with gradient colors. The style of these types are define as:
<style>
.CheckBoxButton
{
  border-radius:5px;
  background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0.10, #2a8ce0), color-stop(0.90, #96d0f6) );
  background-image: -moz-linear-gradient(center bottom, #2a8ce0 10%,#96d0f6 90% );
  height:44px;
  margin-top:10px;
  margin-left:10px;
  float:left;
  min-width:14%;
  width:auto;
}
.CheckBox
{
  float:left;
  width:9.5%;
  margin-top:10px;
  margin-left:10px;
}
.CheckBoxText
{
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: #ffffff;
  text-align: left;
  line-height:42px;
  float:left;
  padding-left:10px;
  padding-right:5px;
}
.CheckBoxButton_selected
{
  border-radius:5px;
  background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0.10, #545353), color-stop(0.90, #9f9f9f) );
  background-image: -moz-linear-gradient(center bottom, #545353 10%,#9f9f9f 90% );
  background-color:#7cc3f0;
  height:44px;
  margin-top:10px;
  margin-left:10px;
  float:left;
  min-width:14%;
  width:auto;
}

</style>
You can use these styles classes in the body tag of your html page as following:
<div id=”divCheckbox” class=”CheckBoxButton” onclick=”ChangeStyle(‘chkCheckbox’, ‘divCheckbox’)“>
                <div class=”CheckBox“><input id=”chkCheckbox” type=”checkbox” /></div>
                <div class=”CheckBoxText“><Label >Sample Check Box</Label></div>
</div>
<div id=”divRadio” onclick=”ChangeStyle(‘chkRadio’, ‘divRadio’)” class=”CheckBoxButton“>
                <div class=”CheckBox“><input id=”chkRadio” type=”radio” /></div>
                <div class=”CheckBoxText“><Label >Sample Radio Button</Label></div>
</div>
Whenever the ‘checkbox’ or radio button is clicked a JavaScript function ChangeStyle is called by taking the parameters of check box or radio button id and div container id.  It changes the style of  check box at run time. let’s take a look on JavaScript function.
<script language="javascript" type="text/javascript">
    function CheckBoxStatus(chkBoxID, btnID) {
      if (document.getElementById(chkBoxID).checked) {
           document.getElementById(chkBoxID).checked = false;
           document.getElementById(btnID).setAttribute("class", "CheckBoxButton_selected");
      }
      else {
           document.getElementById(btnID).setAttribute("class", "CheckBoxButton");
           document.getElementById(chkBoxID).checked = true;
      }
}
</script>

Related Posts Plugin for WordPress, Blogger...