Showing posts with label Live Demo. Show all posts
Showing posts with label Live Demo. Show all posts

Friday, March 15, 2013

Jquery Tooltip Animation and Buttons with JSFiddle Demo



Here is the Coding for Jquery Tooltip and buttons.Buttons will be displayed as Jquery buttons and when mouse is hovered on the buttons Jquery tooltip is displayed with slideDown effect and delay of 350 milliseconds.


 $(function(){

      $("input[type=button]").button();  //This applies Jqeury buttons for input type fields of type buttons

     $("input[type=button]").tooltip(); //This applies Jquery tooltip for input type fields of type buttons
     $('.classname').tooltip({show: {
effect: "slideDown",
delay: 350
}
});   //This applies Jquery tooltip animation effects for input fields with class as classname

  });


Include the above coding in <script> tag 

 <input type="button" value="Hover" title="You got">
    <input type="button" class="classname" value="Animation tooltip" title="Awesome Tooltip with some delay and animation">

Include the above coding in body tag


Tuesday, March 12, 2013

Jquery Tabs Example with minimum height of tabs and right alignment of a tab

The Jquery Tabs example code is shown below,Each Tab is displayed with minimum height of 400px.
            Logout tab is displayed in right side.For Logout tab,InLine CSS (style="float:right") is used for displaying in right side.When user clicks on Logout tab the page will be redirected to logout.jsp, if logout.jsp html page is available

View  Demo in JSFiddle ,
 copy and paste this url in your browser http://jsfiddle.net/6uqM8/ 


<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Home Page - Library Management</title>
          <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
       <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
      <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
      <link rel="stylesheet" href="/resources/demos/style.css" />
        <script> 
               $(function() {
                $( "#tabs" ).tabs();
                $("#tabs").css({backgroundColor:'#ffe4e1'});
                $("#tabs").css("min-height", "400px");
            });      
        </script>
    </head>
     <body>
         <div id="tabs" class="tabs" >

            <ul style="color: black;background-color: #b85c5c">
                <li ><a href="#tabs-1" style="color: #b85c5c;background-color:#ffe4e1;" >Home</a></li>
                <li ><a href="#tabs-2" style="color: #b85c5c;background-color:#ffe4e1">Create Book</a></li>  
                <li style="float:right"><a onClick="location.href='logout.jsp'" style="color: #b85c5c;background-color:#ffe4e1">Log Out</a></li>
            </ul>

            <div id="tabs-1">
                <p id="intro">
                    Welcome to my Home Page of Library Management Application! This Provides effective solutions needed for a Library.Click any tab to load content from other pages.
                </p>
        </div>

          <div id="tabs-2">
                <p >
              This is the Second Tab Contents
                </p>
        </div>

    </div>

    </body>
</html>



View  Demo in JSFiddle ,
 copy and paste this url in your browser http://jsfiddle.net/6uqM8/

Thursday, January 10, 2013

HTML code with JavaScripting for performing Arithmetic Operations


The following code displays two fields for taking two input numbers and there are separate buttons for four arithmetic operations.When Clicked on a button,alert message is displayed with result and result is also updated in the page.

   Four JavaScript functions are defined in the script tag.Four functions are used for addition,subtraction,multiplication,division.Four Separate buttons are defined in the body tag.The values of the four buttons are Addition,Subtraction,Deletion and Multiplication.

        When a user clicks on the button with value Addition,Addition function is called.Addition function takes the values from the two input fields and performs addition,then alert message is displayed with result and result is also displayed in the webpage.


Check The Live Demo here or Copy,paste this url  http://jsfiddle.net/6JmuY/

<html>
<head>
<title>Arithmetic operations</title>
</head>
<script type="text/javascript">
function Addition()
{
x=parseFloat(calc.value1.value);
y=parseFloat(calc.value2.value);
z=(x+y);
alert("The Addition result is"+z);
calc.value3.value=z
}
function Subtraction()
{
var x,y,z;
x=calc.value1.value;
y=calc.value2.value;
z=x-y;
alert("The subtraction result is "+z);
calc.value3.value=z
}
function Multiplication()
{
var x,y,z;
x=calc.value1.value;
y=calc.value2.value;
z=x*y;
alert("The Multiplication result is "+z);
calc.value3.value=z
}
function Division()
{
var x,y,z;
x=calc.value1.value;
y=calc.value2.value;
z=x/y;
alert("The subtraction result is "+z);
calc.value3.value=z
}
</script>
</head>
<body>
<form name="calc">
<h1>Online Calculator</h1>
Enter first Numeric Value :   <input type="number" id="value1"> </br>
Enter Second Numeric Value : <input type="number" id="value2"> </br>
 </br>
Result of the Arithmetic operation is : <output type="number" id="value3"> </output></br>
<input type="button" Value="Addition" onClick=Addition()> </br>
<input type="button" Value="Subtraction" onClick=Subtraction()></br>
<input type="button" Value="Multiplication" onClick=Multiplication()></br>
<input type="button" Value="Division" onClick=Division()></br>
</form>
</body>
</html>