Posts

Showing posts with the label jquery

Page Unload Show Notification to user

<script>       jQuery("body").append("<div style='background-color: #f5f5f5; position: fixed; top: 0px; left: 0px; right: 0px; bottom: 0px; z-index: 99999;display:none;opacity: 0.8;' id='pageloader'><img src='http://217.37.162.106/sme/logo/ajax-loader.gif' style='top: 50%; left: 50%; max-width: 30px; position: fixed;' /></div>"); jQuery(window).on('beforeunload', function(){ jQuery("#pageloader").css("display","block"); }); </script>

Get Factorial of a Number using jQuery

Image
In mathematics, the  factorial  of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example, The value of 0! is 1, according to the convention for an empty product. Read full about  factorial    here  on  wikipedia. We will use For loop for getting  factorial   of  a number, so we just have to decrease value by one and multiply with previous holding temporary value, We have to initiate temporary value with 1. The Following will be code: <input type="text" name="factroial4" id="factroial4" /> <br/> <button type="button" name="button" onclick="GetFactorial();" /> Calculate Factorial </button> <br/> <div id="showresulthere"></div> <script src="//code.jquery.com/jquery-1.11.2.min.js"></script> <script>  // function defination  function GetFactorial()    {

What is jQuery?

Make a Custom Slider Using JQuery

Image
<div dir="ltr" style="text-align: left;" trbidi="on"> <div dir="ltr" style="text-align: left;" trbidi="on"> <style>  .userslider   {    margin: 10px 0px;   }  .users   {    display:none;   }  #user1   {    display:block;   } </style> <div dir="ltr" style="text-align: left;" trbidi="on"> <div> <ul class="userslider" style="height: 0px; overflow: hidden;"> <li> <img class="users" src="http://betadating.ilearnersindia.com/img/slider/1.jpg" id="user1" style="display: none;" /> </li> <li> <img class="users" src="http://betadating.ilearnersindia.com/img/slider/2.jpg" id="user2" style="display: none;" /> </li> <li> <img class="u

Plane Example in JQuery

Please Follow the Link for DEMO

A Program in Jquery for Excercise - Jquery

Image
A Program in Jquery for Pity - Jquery: Style to be Define (CSS): body { margin:0px; padding:0px;background:#cc0000; } .container { margin:0px auto; padding:10px; background:#0f0f0f; position:relative; min-height:100%; width:350px; text-align: center; } .container img { display:none; max-width:100%; } .container h3 { background: #cc0000; color: aqua; padding: 5px 5px; font-size: 35px; font-weight: normal; font-family: arial; } Script to be Define (.js file): /* A JQuery Program to run a Excercise */ function startpity() { $("#gamestatus").val('1'); } function stoppity() { $("#gamestatus").val('0'); } var runningtimer = 0; var starttimer = 0; var stoptimer = 0; function runthepity() { runningtimer++; var gamestatus = $("#gamestatus").val(); if( gamestatus ==1  ) { starttimer++; console.log('pity is run for '+starttim

A Basic Program on Jquery

Image
Jquery is client-side language, which makes easy processing and less server load on server. As its run on client side and perform a useful function, like we don't have to refresh all the page to get the output on the browser. This include checking the Text fields requirement, changing the color for a particular block or Div. We will cover all this on later in the blog. Currently we will know the basic for the jquery. First we need to include the jQuery File on the page, before calling the  Our defined Function or code. We can download the latest file from the jQuery Site or simply include the path of the jQuery site. Reference:   http://jquery.com/ You can check the latest link from here #################################### jQuery Program #################################### <html> <head> <title> Start with jQuery </title> <!-- include the jQuery File form the jQuery site --> <script src="//c

Text Slider

Running Example: PHP is a server side language. JQUERY is a client side language. CSS is used for styling attribute to be called at once. MYSQL is used for storing the database. Here I am describing, how to used Text slider: First we need to define style:   .h1_title  { font-size: 20px;line-height: 22px;font-family: 'Patua One', cursive;font-weight: normal; text-transform: uppercase; letter-spacing: 4px; color:#e7decf;text-align: center; width:50%;padding-top: 25px;display:none; } HTML to be define: <div class="textslider"> <input type="hidden" id="h1countvalue" name="h1countvalue" value="1"/> <h1 class="h1_title" id="h1_title1" style="display:block;">WE OFFER OUR CLIENT EXPERT LEGAL ADVICE<br>ALWAYS PROTECT CLIENTS INTERESTS</h1> <h1 class="h1_title" id="h1_title2">WE OFFER OUR CLIENT EXPERT LEGAL ADV