Home
Search results “Js style font family” for the 2015
Changing the text in javascript
 
06:08
Tutorials : Javascript Learn Javascript In Just One Hour JavaScript in one hour - learn a new skill and earn more money! Not only is JavaScript easy to learn using my simple but effective methods, but it need only take an hour! JavaScript is in demand! Javascript coding is one of the most in-demand skills - if you can code in JavaScript you have a job. A well paid job! Intro Part 1 Intro Part 2 HTML, CSS, Javascript Adding in a button and a function Scaling functions Changing the text in javascript Variables Adding variables Adding user input Variable scope Saving your project Calling functions within functions If statements Else statements More on variable scope Else if statement Changing the style tags with javascript Course conclusion --- Cascading Style Sheets, HTML, tutorial, lesson, css, web, design, webpage, Web Development, build a website , css styles, developer tools, HTML (Programming Language), Cascading Style Sheets (Programming Language), Tutorial (Media Genre), online course, Programming Language, JavaScript (Programming Language)
Views: 5663 CodeAcademy
Increase decrease font size using jquery
 
07:58
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/05/increase-decrease-font-size-using-jquery.html In this video we will discuss how to increase, decrease and reset font size using jQuery Replace < with LESSTHAN symbol and > with GREATERTHAN symbol <html> <head> <style> .divClass { font-size: 16px; background-color: #E3E3E3; width: 500px; padding: 5px; } </style> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#linkIncrease').click(function () { modifyFontSize('increase'); }); $('#linkDecrease').click(function () { modifyFontSize('decrease'); }); $('#linkReset').click(function () { modifyFontSize('reset'); }) function modifyFontSize(flag) { var divElement = $('#divContent'); var currentFontSize = parseInt(divElement.css('font-size')); if (flag == 'increase') currentFontSize += 3; else if (flag == 'decrease') currentFontSize -= 3; else currentFontSize = 16; divElement.css('font-size', currentFontSize); } }); </script> </head> <body style="font-family:Arial"> Font-Size: <a id="linkIncrease" href="#">Increase</a> <a id="linkDecrease" href="#">Decrease</a> <a id="linkReset" href="#">Reset</a> <br /><br /> <div id="divContent" class="divClass"> <b>jQuery Tutorial</b> <ul> <li>What is jQuery</li> <li>What is $(document).ready(function() in jquery</li> <li>Benefits of using CDN</li> <li>#id selector</li> <li>Element Selector</li> <li>class selector</li> <li>attribute selector</li> <li>attribute value selectors</li> <li>case insensitive attribute selector</li> <li>jQuery input vs :input</li> </ul> </div> </body> </html>
Views: 23559 kudvenkat
Using style of Font-Family in HTML
 
03:43
use font-family, font-size on HTML. E-mail: [email protected] Site: dev.sombochea.com Create more, Develop more, and get more knowledge.
Views: 154 CHEA SAMBO
Basics of HTML - Tutorial 9 - How to Change the Font for a Webpage (font-family)
 
05:22
check out my website for all my tutorials: http://carlsapty.com/ to see all my tutorials, check out my tutorials at http://carlsapty.com/tutorials-2/ this video is to show you how to change the font styling on a Webpage using HTML. if you would like me to make a video about something specific, drop me an email, or if you have only a small question then i should be able to help as soon as possible! if you have any questions, email me on my website or leave a comment!
Views: 1120 Carl Saptarshi
Mastering CSS: The @font-face Property | packtpub.com
 
04:28
Part of 'Mastering CSS' video series. For full Course visit: http://bit.ly/1MW11Ar There were only so many “web safe” fonts out there until Web Fonts came along. • Add the OTF file to the site folder • Define new fonts in CSS • Apply the font to elements For the latest web development video tutorials, please visit http://bit.ly/1KYwKQ5 Find us on Facebook -- http://www.facebook.com/Packtvideo Follow us on Twitter - http://www.twitter.com/packtvideo
Views: 232 Packt Video
Bootstrap for Beginners - 6 – Adding and Custom Web Fonts and Improving the Layout
 
09:01
This tutorial covers how to add custom web fonts from theGoogle content distribution network. Also, topics include improving the overall layout of the website layout. Introduction Song: Awel by Stefsax http://dig.ccmixter.org/files/stefsax/7785
Views: 4375 Mad Dog Tutorials
jQuery each function
 
15:38
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/jquery-each-function.html In this video we will discuss 1. Use of jQuery each function 2. How to exit from each function in jQuery 3. Implicit iteration in jQuery 4. Performance considerations when using jquery each function jQuery each function is used to iterate over the items in a collection. For each item in the collection the anonymous function is called. The index of the element and the element itself are passed to the anonymous function. $('li').each(function (index, element) { alert(index + ' : ' + $(element).text()); }); To refer to the current element that we are iterating over you can also use this keyword. $('li').each(function (index) { alert(index + ' : ' + $(this).text()); }); If you don't care about the index and just need the text of the list item, then you can get rid of the index parameter $('li').each(function () { alert($(this).text()); }); Replace < with LESSTHAN symbol and > with GREATERTHAN symbol How to exit from each function in jQuery : To exit from each function, return false. <script type="text/javascript"> $(document).ready(function () { $('li').each(function () { if ($(this).text() == 'UK') { return false; } alert($(this).text()); }); }); </script> Implicit iteration in jQuery : The $('li') selector returns all list item elements. Notice that we are calling the css() jquery function on the jquery collection itself. In this case, css() method implicitly iterates over each element in the entire collection. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('li').css('color', 'red'); }); </script> </head> <body style="font-family:Arial"> <ul> <li>US</li> <li>India</li> <li>UK</li> <li>Canada</li> <li>Australia</li> </ul> </body> </html> There is no need to explicitly iterate over each element in the collection. Most jQuery methods implicitly iterate over the entire collection. <script type="text/javascript"> $(document).ready(function () { $('li').each(function () { $(this).css('color', 'red'); }); }); </script> Performance considerations when using jquery each function <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('li').each(function () { $('#divResult').html($('#divResult').html() + '<br/>' + $(this).text()) }); }); </script> </head> <body style="font-family:Arial"> <ul> <li>US</li> <li>India</li> <li>UK</li> <li>Canada</li> <li>Australia</li> </ul> <div id="divResult"></div> </body> </html> From a performance standpoint, there are 2 problems with the above code. 1. jQuery needs to search the DOM for div element with id = divResult, for each list item in the collection. Since there are 5 list items, jquery searches the DOM 5 times for the same div element with id = divResult. The performance of the above code can be improved by caching the divResult element. 2. The DOM element (div element with id = divResult) is being updated on each iteration. Again this is bad for performance. To improve the performance build a string variable with the required data on each iteration of the loop. Once the loop has completed, update the DOM element with the value that is present in the string varibale. This will ensure that the DOM element is updated only once and this is much better for performance. The following is much better from a performance standpoint. <script type="text/javascript"> $(document).ready(function () { var result = ''; $('li').each(function () { result += '<br/>' + $(this).text(); }); $('#divResult').html(result); }); </script>
Views: 85902 kudvenkat
CSS Tutorial For Beginners 30 - Font Weight
 
08:15
Howdy ninjas, in this CSS beginners tutorial we'll take an in-depth look into the font weight property. Font weight in CSS simply means how bold or how light the font displays in a browser. Be aware that not all fonts come with light and bold variations, so the different font weights available in CSS may not work in all cases. One font which has these extra two weights in Windows 8.1 is called Yu Gothic, which I'll be using in this video. Anyway, peace out, have fun and keep on coding :). SUBSCRIBE TO CHANNEL - https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1 ========== CSS for Beginners Playlist ========== https://www.youtube.com/playlist?list=PL4cUxeGkcC9gQeDH6xYhmO-db2mhoTSrT ========== HTML Basics Course ========== https://www.youtube.com/playlist?list=PL4cUxeGkcC9ibZ2TSBaGGNrgh4ZgYE6Cc ========== The Net Ninja ============ For more front-end development tutorials & to black-belt your coding skills, head over to - https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk ========== Social Links ========== Twitter - @TheNetNinja - https://twitter.com/thenetninjauk
Views: 11080 The Net Ninja
JavaScript - 04 - You can change html styles
 
04:08
How to modify html styles using JavaScript. Like my Facebook page : https://www.facebook.com/codeglympse Subscribe My YouTube channel : http://www.youtube.com/ticoontechnologies
Views: 373 PRABEESH R K
دورة CSS الدرس 4 :  شرح خاصية Font Family
 
01:55
دورة CSS الدرس 4 : شرح خاصية Font Family
Views: 15 t3allem Web
jQuery DOM manipulation methods
 
16:55
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/jquery-dom-manipulation-methods.html In this video we will discuss 1. What are jQuery DOM manipulation methods 2. How to set attribute values using jQuery attr() method 3. How to retrieve attribute values using jQuery attr() method 4. How to set multiple attribute values using jQuery attr() method 5. How to remove an attribute using jQuery removeAttr() method What are jQuery DOM manipulation methods jQuery DOM manipulation methods manipulate the DOM in some manner. The complete list of jQuery DOM manipulation methods can be found at the following link. http://api.jquery.com/category/manipulation/ jQuery attr method is used to set or retrieve attribute values of html elements. Retrieves the title attribute value of the first matching element $('div').attr('title') Example : In this example we have 2 DIV elements. Since attr() function retrieves only the attribute value of first matching element, we only get the title attribute value of the first DIV element. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { alert($('div').attr('title')); }); </script> </head> <body style="font-family:Arial"> <div id="div1" title="My DIV1"> DIV 1 </div> <div id="div2" title="My DIV2"> DIV 2 </div> </body> </html> To retrieve the title attribute value of all the matching elements, jQuery each() method can be used. <script type="text/javascript"> $(document).ready(function () { $('div').each(function () { alert($(this).attr('title')); }); }); </script> Sets the title attribute value of all the matching elements to "new div title" $('div').attr('title', 'new div title'); Example : If you want to set the same value for the title attribute of all the elements, then there is no need to loop thru each element. All the div elements in this case will have 'new div title' as the title attribute value. <script type="text/javascript"> $(document).ready(function () { // set the same title attribute value for all the DIV elements $('div').attr('title', 'new div title'); // Retrieve and alert the title attribute value of all DIV elements $('div').each(function () { alert($(this).attr('title')); }); }); </script> If you want to set a different value for the title attribute, then you may need to loop thru each element. <script type="text/javascript"> $(document).ready(function () { // sets a different title attribute value for each DIV element $('div').each(function (i) { $(this).attr('title', 'div ' + (i + 1) + ' title'); }); // Retrieve and alert the title attribute value of all DIV elements $('div').each(function () { alert($(this).attr('title')); }); }); </script> How to set multiple attribute values : Using a JSON object to set multiple attribute values <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var config = { 'title': 'New Div Title', 'style': 'border:3px solid red;', 'name': 'My Div' }; $('div').attr(config); var result = ''; $('div').each(function () { result += 'title = ' + $(this).attr('title') + '<br/>'; result += 'style = ' + $(this).attr('style') + '<br/>'; result += 'name = ' + $(this).attr('name') + '<br/><br/>'; }); $('#resultSpan').html(result); }); </script> </head> <body style="font-family:Arial"> <div id="div1" title="My DIV1"> DIV 1 </div> <br /> <div id="div2" title="My DIV2"> DIV 2 </div> <br /> <span id="resultSpan"> </span> </body> </html> Instead of creating a separate JSON object (config) and then passing it to attr() method, you can create the JSON object inline. $('div').attr({ 'title': 'New Div Title', 'style': 'border:3px solid red;', 'name': 'My Div' });
Views: 68417 kudvenkat
Difference between window height and document height
 
08:15
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/06/difference-between-window-height-and.html In this video we will discuss 1. Difference between window height and document height 2. How to detect if the user has scrolled to the bottom of the page $(window).height() - Returns height of the browser window i.e browser viewport $(document).height() - Returns height of HTML document $(window).scrollTop() - Returns the current vertical position of the scroll bar What is the difference between window height and document height The window height is what you see (i.e browser viewport), but the document height includes everything below or above the visible area. How to detect if the user has scrolled to the bottom of the page Here is the formula to detect if the user has scrolled to the bottom of the page if (verticalScrollBarPosition == $(document).height() - $(window).height()) { floatingDiv.html('Reached the bottom of the page'); } Why window height and document height are the same in Google chrome Without DOCTYPE tag Chrome reports the same value for both window height and document height. Include the following DOCTYPE declaration <!DOCTYPE html> Example used in the demo <!DOCTYPE html> <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var floatingDiv = $("#divfloating"); var floatingDivPosition = floatingDiv.position(); $(window).scroll(function () { var scrollPosition = $(window).scrollTop(); if (scrollPosition >= floatingDivPosition.top) { floatingDiv.css({ 'position': 'fixed', 'top': 3 }); } else { floatingDiv.css({ 'position': 'relative', 'top': 0 }); } floatingDiv.html('Window Height = ' + $(window).height() + '<br/>' + 'Document Height = ' + $(document).height() + '<br/>' + 'Vertical Scrollbar Position = ' + scrollPosition ); if (scrollPosition == $(document).height() - $(window).height()) { floatingDiv.html('Reached the bottom of the page'); } }); }); </script> </head> <body style="font-family:Arial;"> <table align="center" border="1" style="border-collapse:collapse"> <tr> <td style="width:500px"> <div> Main Page Content </div> </td> <td style="width:150px; vertical-align:top"> Side panel content <br /><br /> <div id="divfloating" style="background-color:silver; width:150px; height:150px"> Floating Div - Keeps floating as you scroll down the page </div> </td> </tr> </table> </body> </html> In our next video we will discuss how to load data like facebook as you scroll down the page.
Views: 20535 kudvenkat
CSS - Upgrading HTML Tags with Style: Creating a Website Made Easy
 
20:00
Lesson on Upgrading HTML Tags to CSS Style from Udemy online course: Creating a Website Made Easy Full course description and 25% discount coupon: http://tharsishighlands.com/online-courses/creating-a-website-made-easy/ Transcript: In this lesson, we will take many of the basic HTML tags and use them as CSS element selectors to upgrade their style. In CSS, the HTML tags are called "elements." BODY First, we start with the [body] tag element (YouTube does not allow angle brackets in description). When you first set up your main CSS file, you typically want to establish the basics for your entire page. These can include, • background-color • background-image • default font-size, color and font-family All of these can be handled in the body element. For example, body { background-color: linen; background-image: url("pix/tree.jpg"); font-family: Vera, Arial, Helvetica, sans-serif; font-size: 15px; color: #24425C; } SELECTORS We've already seen a little about CSS syntax. For example, h1 { color: blue; } Each CSS style starts with a selector and is followed by one or more declarations within open and close braces — each declaration being a property-value pair: { property: value } Element selectors select all HTML tags of the same name. For instance, for the [p] tag, p { text-align: center; color: red; } [p]All paragraphs with only the p tag are centered and red. This is a demonstration of how the element selector works.[/p] The ID selector uses the ID attribute of an HTML element to select that specific element. ID is a unique identifier. On any one page, there can be only one of that ID. Also, the ID name cannot start with a numeral. For example, #first_heading { color: red; } [h1 id="first_heading"]This is the First Heading on the Page[/h1] The class selector selects all elements with a specific class attribute. .quote { border-style: solid; border-width: 1px; border-color: #880000; padding: 5px; font-size: 18px; font-style: italic; } Here, we see a class called "quote" which uses larger type, italics and a dark red border. Next, is the HTML which uses that class. [p class="quote"]"There are more things in heaven and earth, Horatio, than are dreamt of in your philosophy."[/p] A class can be restricted to only one element type. For example, p.first { text-indent: 0px; } This can be helpful if all other paragraphs are given an indent. The first paragraph after a heading can be made flush left. We can also use more than one class at a time. For example, [p class="first quote"]"Houston, we have a problem..."[/p] We've already seen how selectors which share property values can be grouped. h1, h2, h3 { color: steelblue; } In the earlier lesson on the Head section, we learned how to link to an external style sheet — a file with sets of selectors and declarations. For internal CSS, you have the same selector-declaration combinations, but set within open and close [style] tags. [head] [style] body { background-color: darkslateblue; } [/style] [/head] And for inline CSS, you have the same selector-declaration combinations within a style attribute. [p style="text-indent: 50px; color: steelblue;"]This is important text.[/p] Multiple Styles Cascade into One CSS statements have a sequence of priority. The lowest priority of style is the browser defaults. Next are the external and internal style sheets in the head section. Sequence matters, so if you link to your external style sheet after the internal style declarations, the external CSS takes priority over the internal. Finally, the inline style declarations take the highest priority. For all style information that uses the same selectors, the highest priority replaces the lower priorities. For example, External: p { color: blue; text-indent: 30px; } Internal: p { color: green; } Inline: p { color: red; } The final style is: p { color: red; text-indent: 30px; } Background: The following properties control the background of HTML elements. • background-color • background-image • background-repeat • background-attachment • background-position Example: body { background-color: blue; } As we've already learned, colors can be specified, • As Hex — like "#00ffff" • As RGB — like "rgb(0,255,255)" • By name — like "aqua" We will learn more about colors and the new CSS3 color specification in a later lesson. Background Image: The default behavior of a background image is to repeat the image both vertically and horizontally in order to fill the entire background of the element with the selected picture. body { background-image: url("pix/sandbaked.gif"); } [...] In the next lesson, we talk about fonts, tables and links. Music: "Acid Jazz," "Darkness Speaks," and "Fanfare for Space" by Kevin MacLeod (incompetech.com) Licensed under Creative Commons: By Attribution 3.0 http://creativecommons.org/licenses/by/3.0/ Still: Clear Creek 5 by ImBooToo via Morguefile.com.
Views: 1465 Rod Martin, Jr.
jQuery append elements
 
08:18
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/jquery-append-elements.html In this video we will discuss how to append and prepend elements To append elements we have append() appendTo() To prepend elements we have prepend() prependTo() Since these methods modify DOM, they belong to DOM manipulation category. jquery append example : The following example appends the specified HTML to all div elements <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('div').append('<b> Tutorial</b>'); }); </script> </head> <body style="font-family:Arial"> <div id="div1">jQuery</div> <div id="div2">C#</div> <div id="div3">ASP.NET</div> </body> </html> jquery appendto example : The above example can be rewritten using appendTo as shown below. $('<b> Tutorial</b>').appendTo('div'); What is the difference between append and appendTo Both these methods perform the same task. The only difference is in the syntax. With append method we first specify the target elements and then the content that we want to append, where as we do the opposite with appendTo method. jquery prepend example : The following example prepends the specified HTML to all div elements <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('div').prepend('<b>Tutorial </b>'); }); </script> </head> <body style="font-family:Arial"> <div id="div1">jQuery</div> <div id="div2">C#</div> <div id="div3">ASP.NET</div> </body> </html> jquery prependTo example : The above example can be rewritten using prependTo as shown below. $('<b>Tutorial </b>').prependTo('div'); What is the difference between prepend and prependTo Both these methods perform the same task. The only difference is in the syntax. With prepend method we first specify the target elements and then the content that we want to prepend, where as we do the opposite with prependTo method. jQuery append existing element example : These methods (append, appendTo, prepend, prependTo) can also select an element on the page and insert it into another <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('div').append($('#mySpan')); }); </script> </head> <body style="font-family:Arial"> <span id="mySpan"> Programming</span> <div id="div1">jQuery</div> <div id="div2">C#</div> <div id="div3">ASP.NET</div> </body> </html> Difference between prepend and append prepend method, inserts the specified content to the beginning of each element in the set of matched elements, where as append method inserts the specified content to the end of each element in the set of matched elements.
Views: 53388 kudvenkat
Autocomplete textbox using jquery in asp net
 
17:30
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/06/autocomplete-textbox-using-jquery-in.html In this video we will discuss, how to implement autocomplete textbox using jquery and asp.net. The suggestions should come from the database table. Stored procedure to retrieve employee name suggestions Create proc spGetStudentNames @term nvarchar(50) as Begin Select Name from tblStudents where Name like @term + '%' End StudentHandler.ashx code using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Web; using System.Web.Script.Serialization; namespace Demo { public class StudentHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { string term = context.Request["term"] ?? ""; List<string> listStudentNames = new List<string>(); string cs = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; using (SqlConnection con = new SqlConnection(cs)) { SqlCommand cmd = new SqlCommand("spGetStudentNames", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parameter = new SqlParameter() { ParameterName = "@term", Value = term }; cmd.Parameters.Add(parameter); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { listStudentNames.Add(rdr["Name"].ToString()); } } JavaScriptSerializer js = new JavaScriptSerializer(); context.Response.Write(js.Serialize(listStudentNames)); } public bool IsReusable { get { return false; } } } } Download jQuery UI from jqueryui.com. Copy and paste the following files in your project. a) jquery-ui.js b) jquery-ui.css c) images Add a WebForm to the ASP.NET project. Copy and paste the following HTML and jQuery code. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Demo.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="jquery-1.11.2.js"></script> <script src="jquery-ui.js"></script> <link href="jquery-ui.css" rel="stylesheet" /> <script type="text/javascript"> $(document).ready(function () { $('#txtName').autocomplete({ source: 'StudentHandler.ashx' }); }); </script> </head> <body style="font-family: Arial"> <form id="form1" runat="server"> Student Name : <asp:TextBox ID="txtName" runat="server"> </asp:TextBox> </form> </body> </html>
Views: 56355 kudvenkat
jQuery add or remove class
 
15:46
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/jquery-add-or-remove-class.html In this video we will discuss 1. How to check if an element has a css class 2. How to add or remove css classes 3. How to toggle css classes hasClass - Returns true if an element has the specified class otherwise false addClass - Adds one or more specified classes. To add multiple classes separate them with a space. removeClass - Removes one or multiple or all classes. To remove multiple classes separate them with a space. To remove all classes, don't specify any class name. toggleClass - Toggles one or more specified classes. If the element has the specified class then it is removed, if the class is not present then it is added. Replace < with LESSTHAN symbol and > with GREATERTHAN symbol <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <style> .boldClass { font-weight: bold; } .italicsClass { font-style: italic; } .colorClass { color: red; } </style> <script type="text/javascript"> $(document).ready(function () { $('#btn1').click(function () { $('p').addClass('colorClass'); }); $('#btn2').click(function () { $('p').removeClass('colorClass'); }); $('#btn3').click(function () { $('p').addClass('colorClass italicsClass'); }); $('#btn4').click(function () { $('p').removeClass('colorClass italicsClass'); }); $('#btn5').click(function () { $('p').addClass('colorClass italicsClass boldClass'); }); $('#btn6').click(function () { $('p').removeClass(); }); }); </script> </head> <body style="font-family:Arial"> <p>Pragim Technologies</p> <table> <tr> <td> <input id="btn1" style="width:250px" type="button" value="Add Color Class" /> </td> <td> <input id="btn2" style="width:250px" type="button" value="Remove Color Class" /> </td> </tr> <tr> <td> <input id="btn3" style="width:250px" type="button" value="Add Color and Italics Classes" /> </td> <td> <input id="btn4" style="width:250px" type="button" value="Remove Color and Italics Classes" /> </td> </tr> <tr> <td> <input id="btn5" style="width:250px" type="button" value="Add Color, Italics & Bold Classes" /> </td> <td> <input id="btn6" style="width:250px" type="button" value="Remove All Classes" /> </td> </tr> </table> </body> </html>
Views: 49128 kudvenkat
HTML5-WOFF FONTS HANDLING EXPLAINED
 
06:34
Buy HTML5,CSS3,jQuery,JavaScript books (affiliate): HTML 5 Black Book (Covers CSS3, JavaScript, XML, XHTML, AJAX, PHP, jQuery) https://amzn.to/2MMlVfi HTML & CSS: The Complete Reference https://amzn.to/2PXwgmu Web Design with HTML, CSS, JavaScript and jQuery https://amzn.to/2NdfGQY HTML and CSS: Design and Build Websites https://amzn.to/2NF75DP Learning PHP, MySQL & JavaScript with jQuery, CSS & HTML5 https://amzn.to/2CkbBXk HTML5 : Up And Running- Dive into the Future of Web Development https://amzn.to/2PZz0ji HTML 5 Foundations https://amzn.to/2PwXDmt HTML5 & CSS3 for the Real World https://amzn.to/2NgcuV6 Unraveling Html5, Css3, and Javascript https://amzn.to/2C9Nudw HTML5 and CSS3 Transition, Transformation, and Animation (Open Source) https://amzn.to/2Ckca3o Responsive Web Design with HTML5 and CSS3 https://amzn.to/2PXnAwt Single Page Web Applications: JavaScript end-to-end https://amzn.to/2N8W7JD ------------------------------------- HTML5-WOFF FONTS HANDLING EXPLAINED
Views: 458 LearnEveryone
Passing data to event handler in jQuery
 
06:16
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/passing-data-to-event-handler-in-jquery.html In this video we will discuss how to pass data to the event handler function in jQuery The following example, 1. Binds the click event handler to the button using on function 2. We are passing 3 arguments to the on() function a) The name of the event b) JSON object that contains data that we want to pass to the event handler c) Event handler method name 3. In the event handler method (sayHello), we access the data using event object's data property. Replace < with LESSTHAN symbol and > with GREATERTHAN symbol <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#btnClickMe').on('click', { firstName: 'John', lastName: 'Doe' }, sayHello); $('#btnClickMe').on('click', { firstName: 'Mary' }, sayHello); $('#btnClickMe').on('click', sayHello); function sayHello(event) { if (event.data == null) { alert('No name provided'); } else { alert('Hello ' + event.data.firstName + (event.data.lastName != null ? ' ' + event.data.lastName : '')); } } }); </script> </head> <body style="font-family:Arial"> <input id="btnClickMe" type="button" value="Click Me" /> </body> </html> Output : Hello John Doe Hello Mary No name provided
Views: 38586 kudvenkat
jQuery method chaining
 
11:40
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/jquery-method-chaining.html In this video we will discuss 1. What is method chaining 2. How method chaining works 3. When will method chaining not work Let us understand this with an example. Consider the following HTML <ul> <li>US</li> <li>India</li> <li>UK</li> <li>Canada</li> <li>Australia</li> </ul> Our jQuery code should do the following 1. Change the color of all the list items to blue 2. All the list items should slide down (animation) 3. All the list items should slide up (animation) 4. Change the title attribute of all the list items to MY TITLE One way to do this is by using the following jQuery code. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('li').css('color','blue'); $('li').slideUp(1000); $('li').slideDown(1000); $('li').attr('title', 'MY TITLE'); }); </script> </head> <body style="font-family:Arial"> <ul> <li>US</li> <li>India</li> <li>UK</li> <li>Canada</li> <li>Australia</li> </ul> </body> </html> Instead the jQuery methods can be chained as shown below. <script type="text/javascript"> $(document).ready(function () { $('li').css('color', 'blue').slideUp(1000).slideDown(1000).attr('title', 'MY TITLE'); }); </script> How does method chaining work 1. $('li') returns a jquery collection object that contains all the elements that match the selector 2. On the collection object css() method is called. This method applies the color to all the elements in the collection and returns the collection again. 3. On the collection that is returned by the css() method, the slideUp() method is called. 4. This process continues until we reach the last method in the chain. When chaining methods like this, the line of code will become quite long and the readability will be lost. To improve the readability of the code you can format chained methods as shown below. <script type="text/javascript"> $(document).ready(function () { $('li') .css('color', 'blue') .slideUp(1000) .slideDown(1000) .attr('title', 'MY TITLE'); }); </script> When will method chaining not work Method chaining will not work if a method in the chain does not return an object. In the example below, text() method returns a string that contains the text of all the list items and not an object. Hence the chaining does not work in this case. <script type="text/javascript"> $(document).ready(function () { $('li') .text() .css('color', 'blue') .slideUp(1000) .slideDown(1000) .attr('title', 'MY TITLE'); }); </script> With the same example, method chaining works, if you use text() method to set the value for the list item. In this case, text() method sets a value for each list item in the jQuery collection object and returns that collection object. Hence the chaining works. <script type="text/javascript"> $(document).ready(function () { $('li') .text('MY VALUE') .css('color', 'blue') .slideUp(1000) .slideDown(1000) .attr('title', 'MY TITLE'); }); </script>
Views: 56362 kudvenkat
jQuery input vs input
 
06:29
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/03/jquery-input-vs-input.html In this video we will discuss the difference between $(input) and $(:input) selectors $(:input) selects all input, textarea, select and button elements where as $(input) just selects elements with an input tag. The following is the HTML used in the examples. Replace < with LESSTHAN symbol and > with GREATERTHAN Symbol. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> </head> <body style="font-family:Arial"> First Name : <input type="text" value="John" /> <br /><br /> Last Name : <input type="text" value="Major" /> <br /><br /> Gender : <input type="radio" name="gender" checked="checked" value="Male">Male <input type="radio" name="gender" value="Female">Female <br /><br /> Skills : <input type="checkbox" name="skills" checked="checked" value="JavaScript" />JavaScript <input type="checkbox" name="skills" checked="checked" value="jQuery" />jQuery <input type="checkbox" name="skills" value="C#" />C# <br /><br /> Country: <select> <option selected="selected" value="USA">USA</option> <option value="India">India</option> <option value="UK">UK</option> </select> <br /><br /> Summary : <br /> <textarea>I am a Senior Dot Net Developer with 10 years experience</textarea> <br /><br /> <input type="submit" value="submit" /> </body> </html> Now we want to get the text value from all the textboxes. On this page we have 2 textboxes 1. First Name 2. Last Name jQuery code to get textbox value using $(input) <script type="text/javascript"> $(document).ready(function () { $('input[type="text"]').each(function () { alert($(this).val()); }); }); </script> jQuery code to get textbox value using $(:input) <script type="text/javascript"> $(document).ready(function () { $(':input[type="text"]').each(function () { alert($(this).val()); }); }); </script> Which one is better for performance $('input[type="text"]') or $(':input[type="text"]') $('input[type="text"]') is better for performance over $(':input[type="text"]'). This is because $(':input[type="text"]') needs to scan all input elements, textarea, select etc, where as $('input[type="text"]') scans only input elements. So if you want to find elements with an input tag, it is always better to use $('input[type="text"]') over $(':input[type="text"]')
Views: 87753 kudvenkat
Load data on page scroll using jquery
 
22:19
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/06/load-data-on-page-scroll-using-jquery.html In this video we will discuss, how to load more data on page scroll using jQuery AJAX. This is similar to Facebook. As you scroll down on the page more data will be loaded. When the page is initially loaded we want to retrieve and display the first 50 rows from the database table tblEmployee. As we scroll down and when we hit the bottom of the page we want to load the next set of 50 rows. Stored procedure Create procedure spGetEmployees @PageNumber int, @PageSize int as Begin Declare @StartRow int Declare @EndRow int Set @StartRow = ((@PageNumber - 1) * @PageSize) + 1 Set @EndRow = @PageNumber * @PageSize; WITH RESULT AS ( SELECT Id, Name, Gender, Salary, ROW_NUMBER() OVER (ORDER BY ID ASC) AS ROWNUMBER From tblEmployee ) SELECT * FROM RESULT WHERE ROWNUMBER BETWEEN @StartRow AND @EndRow End HTML page <!DOCTYPE html> <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var currentPage = 1; loadPageData(currentPage); $(window).scroll(function () { if ($(window).scrollTop() == $(document).height() - $(window).height()) { currentPage += 1; loadPageData(currentPage); } }); function loadPageData(currentPageNumber) { $.ajax({ url: 'EmployeeService.asmx/GetEmployees', method: 'post', dataType: "json", data: { pageNumber: currentPageNumber, pageSize: 50 }, success: function (data) { var employeeTable = $('#tblEmployee tbody'); $(data).each(function (index, emp) { employeeTable.append('<tr><td>' + emp.ID + '</td><td>' + emp.Name + '</td><td>' + emp.Gender + '</td><td>' + emp.Salary + '</td></tr>'); }); }, error: function (err) { alert(err); } }); } }); </script> </head> <body style="font-family:Arial"> <h1>The data will be loaded on demand as you scroll down the page</h1> <table id="tblEmployee" border="1" style="border-collapse:collapse; font-size:xx-large"> <thead> <tr> <th>ID</th> <th>Name</th> <th>Gender</th> <th>Salary</th> </tr> </thead> <tbody></tbody> </table> </body> </html>
Views: 42550 kudvenkat
How to use external font in HTML
 
09:46
Easy way to add fonts in HTML page. Download file: http://rony.jamunait.com/devers/html_tutorial.zip mail: [email protected]
Views: 8805 Manir
jQuery checked selector
 
10:35
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/03/jquery-checked-selector.html In this video we will discuss the jQuery :checked selector. The :checked selector selects all checked checkboxes or radio buttons. Let us understand this with an example. Selects all checked radio button elements $('input[type="radio"]:checked') Example : When you click the submit button without selecting any radio button, "No radio button checked" message should be displayed. When you click the submit button after a radio button is checked, then a message stating "Male is checked" or "Female is checked" should be displayed. Replace < with LESSTHAN symbol and > with GREATERTHAN symbol. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#btnSubmit').click(function () { var result = $('input[type="radio"]:checked'); if (result.length > 0) { $('#divResult').html(result.val() + " is checked"); } else { $('#divResult').html("No radio button checked"); } }); }); </script> </head> <body style="font-family:Arial"> Gender : <input type="radio" name="gender" value="Male">Male <input type="radio" name="gender" value="Female">Female <br /><br /> <input id="btnSubmit" type="submit" value="submit" /> <br /><br /> <div id="divResult"> </div> </body> </html> Selects all checked checkbox elements $('input[type="checkbox"]:checked') Example : When you click the submit button without checking any checkbox, "No checkbox checked" message should be displayed. When you click the submit button after checking a checkbox, then a message stating the number of checkboxes checked and their values should be displayed. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#btnSubmit').click(function () { var result = $('input[type="checkbox"]:checked'); if (result.length > 0) { var resultString = result.length + " checkboxe(s) checked<br/>"; result.each(function () { resultString += $(this).val() + "<br/>"; }); $('#divResult').html(resultString); } else { $('#divResult').html("No checkbox checked"); } }); }); </script> </head> <body style="font-family:Arial"> Skills : <input type="checkbox" name="skills" value="JavaScript" />JavaScript <input type="checkbox" name="skills" value="jQuery" />jQuery <input type="checkbox" name="skills" value="C#" />C# <input type="checkbox" name="skills" value="VB" />VB <br /><br /> <input id="btnSubmit" type="submit" value="submit" /> <br /><br /> <div id="divResult"> </div> </body> </html>
Views: 98130 kudvenkat
jQuery wrap elements
 
06:52
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/jquery-wrap-elements.html In this video we will discuss how to wrap and unwrap elements The following jquery methods are used to wrap and unwrap elements. Since these methods modify DOM, they belong to DOM manipulation category. wrap unwrap wrapAll wrapInner wrap - Wrap an HTML structure around each element in the set of matched elements. Consider the following HTML <div id="div1"> DIV 1 </div> <div id="div2"> DIV 2 </div> <div id="div3"> DIV 3 </div> The following line of code wraps each of the above div element with another div element. $('div').wrap('<div class="containerDiv"></div>'); So the HTML in the DOM would now look as shown below. To view the DOM HTML use the browser developer tools. <div class="containerDiv"> <div id="div1"> DIV 1 </div> </div> <div class="containerDiv"> <div id="div2"> DIV 2 </div> </div> <div class="containerDiv"> <div id="div3"> DIV 3 </div> </div> Example : <html> <head> <title></title> <style> .containerDiv { background-color:red; color:white; font-weight:bold; margin: 5px; } </style> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { alert($('div.containerDiv').length); $('div').wrap('<div class="containerDiv"></div>'); alert($('div.containerDiv').length); }); </script> </head> <body style="font-family:Arial"> <div id="div1"> DIV 1 </div> <div id="div2"> DIV 2 </div> <div id="div3"> DIV 3 </div> </body> </html> unwrap - Remove the parents of the set of matched elements from the DOM. Example : <html> <head> <title></title> <style> .containerDiv { background-color:red; color:white; font-weight:bold; margin: 5px; } </style> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { alert($('div.containerDiv').length); $('div').wrap('<div class="containerDiv"></div>'); alert($('div.containerDiv').length); $('div').unwrap(); alert($('div.containerDiv').length); }); </script> </head> <body style="font-family:Arial"> <div id="div1"> DIV 1 </div> <div id="div2"> DIV 2 </div> <div id="div3"> DIV 3 </div> </body> </html> wrapAll - Wrap an HTML structure around all elements in the set of matched elements. Consider the following HTML <div id="div1"> DIV 1 </div> <div id="div2"> DIV 2 </div> <div id="div3"> DIV 3 </div> The following line of code wraps all of the matching div element with another div element. $('div').wrapAll('<div class="containerDiv"></div>'); So the HTML in the DOM would now look as shown below. <div class="containerDiv"> <div id="div1"> DIV 1 </div><div id="div2"> DIV 2 </div><div id="div3"> DIV 3 </div> </div> wrapInner - Wrap an HTML structure around the content of each element in the set of matched elements. Consider the following HTML <div id="div1"> DIV 1 </div> <div id="div2"> DIV 2 </div> <div id="div3"> DIV 3 </div> The following line of code wraps each of the above div element content with another div element. $('div').wrapInner('<div class="containerDiv"></div>'); So the HTML in the DOM would now look as shown below. <div id="div1"> <div class="containerDiv"> DIV 1 </div> </div> <div id="div2"> <div class="containerDiv"> DIV 2 </div> </div> <div id="div3"> <div class="containerDiv"> DIV 3 </div> </div>
Views: 46513 kudvenkat
jQuery selected selector
 
07:41
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/jquery-selected-selector.html In this video we will discuss jQuery :selected selector. To select all checked checkboxes or radio buttons, we use :checked selector. To select all selected options of a select element use :selected selector. How to get selected option from single select dropdown in jquery : We want to get the selected option text and value Replace < with LESSTHAN symbol and > with GREATERTHAN symbol. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#selectCountries').change(function () { var selectedOption = $('#selectCountries option:selected'); $('#divResult').html('Value = ' + selectedOption.val() + ', Text = ' + selectedOption.text()); }); }); </script> </head> <body style="font-family:Arial"> Country: <select id="selectCountries"> <option selected="selected" value="USA">United States</option> <option value="IND">India</option> <option value="UK">United Kingdom</option> <option value="CA">Canada</option> <option value="AU">Australia</option> </select> <br /><br /> <div id="divResult"></div> </body> </html> How to get all selected options from multi select dropdown in jquery : We want to get all the selected options text and value. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#selectCountries').change(function () { var selectedOptions = $('#selectCountries option:selected'); if (selectedOptions.length > 0) { var resultString = ''; selectedOptions.each(function () { resultString += 'Value = ' + $(this).val() + ', Text = ' + $(this).text() + '<br/>'; }); $('#divResult').html(resultString); } }); }); </script> </head> <body style="font-family:Arial"> <select id="selectCountries" multiple="multiple"> <option selected="selected" value="USA">United States</option> <option value="IND">India</option> <option value="UK">United Kingdom</option> <option value="CA">Canada</option> <option value="AU">Australia</option> </select> <br /><br /> <div id="divResult"></div> </body> </html> Please note : Hold down the CTRL key, to select more than one item.
Views: 77706 kudvenkat
Difference between $ each and  each
 
10:13
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/difference-between-each-and-each.html In jQuery there are 2 versions of each() method 1. .each() 2. $.each() or jQuery.each() Please note : $ is shortcut for jQuery. What is the difference .each is used to iterate over the items in a jQuery collection Example : In this example, the jQuery selector $('li') returns a jQuery object collection. So to loop thru the objects in the jQuery collection we are using .each() method. Notice this method is called on the jQuery object collection, that the selector returns, so the .each() method knows the items it has to iterate over. The callback method has 2 parameters 1) index - The index of the element 2) element - The DOM element that we are currently iterating over Since the element is a raw DOM object, to use use jQuery methods you have to wrap it using the jQuery wrapper $ as shown below. $(element) Instead of using element parameter, you can also use this keyword, which also refers to the raw DOM element that we are currently iterating over. To use jQuery methods you have to wrap it using the jQuery wrapper $ as shown below. $(this) Replace < with LESSTHAN symbol and > with GREATERTHAN symbol. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var result = ''; $('li').each(function (index, element) { result += 'Index = ' + index + ', Value = ' + $(element).text() + '<br/>'; //or //result += 'Index = ' + index + ', Value = ' + $(this).text() + '<br/>'; }); $('#resultDiv').html(result); }); </script> </head> <body style="font-family:Arial"> <ul> <li>US</li> <li>India</li> <li>UK</li> <li>Canada</li> <li>Australia</li> </ul> <div id="resultDiv"></div> </body> </html> $.each() or jQuery.each() is used for iterating over javascript objects and arrays. Example : In the example below intArray is a JavaScript array. So to loop thru the elements in the array we are using $.each() function. Notice this function has 2 parameters 1) The JavaScript object or array that we want to iterate over 2) The callback function that will execute on each iteration If you want to use .each() instead of $.each() function on the intArray object, wrap it using the jQuery wrapper $ as shown below. $(intArray).each(function (index, element) { result += 'Index = ' + index + ', Value = ' + element + '<br />'; }) <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var intArray = [100, 200, 300, 400, 500]; var result = ''; $.each(intArray, function (index, element) { result += 'Index = ' + index + ', Value = ' + element + '<br/>'; }); $('#resultDiv').html(result); }); </script> </head> <body style="font-family:Arial"> <div id="resultDiv"></div> </body> </html> Using $.each() to iterate over a JavaScript object : In this example, jsObject is a JavaScript object. In this example, $.each() is used to iterate over the JavaScript object properties. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var jsObject = { 'USA': 'Washington D.C.', 'India': 'New Delhi', 'UK': 'London', 'Australia': 'Canberra' }; var result = ''; $.each(jsObject, function (key, value) { result += key + ' - ' + value + '<br/>'; }); $('#resultDiv').html(result); }); </script> </head> <body style="font-family:Arial"> <div id="resultDiv"></div> </body> </html> In summary, .each() method is used to iterate over the items in a jQuery collection where as $.each() method is used to iterate over javascript objects or arrays.
Views: 44916 kudvenkat
Embedding fonts using CSS @font face rule in HTML pages
 
05:56
Embedding fonts using CSS @font face rule in HTML pages
Views: 2085 XcriptMonster
jQuery dynamic menu from database in asp net
 
24:37
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/07/jquery-dynamic-menu-from-database-in.html In this video we will discuss, how to build a jQuery menu using data from a database table. Menu.cs class using System.Collections.Generic; namespace Demo { public class Menu { public int Id { get; set; } public string MenuText { get; set; } public int? ParentId { get; set; } public bool Active { get; set; } public List<Menu> List { get; set; } } } MenuHandler.ashx using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Web; using System.Web.Script.Serialization; namespace Demo { public class MenuHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { string cs = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; List<Menu> listMenu = new List<Menu>(); using (SqlConnection con = new SqlConnection(cs)) { SqlCommand cmd = new SqlCommand("spGetMenuData", con); cmd.CommandType = CommandType.StoredProcedure; con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { Menu menu = new Menu(); menu.Id = Convert.ToInt32(rdr["Id"]); menu.MenuText = rdr["MenuText"].ToString(); menu.ParentId = rdr["ParentId"] != DBNull.Value ? Convert.ToInt32(rdr["ParentId"]) : (int?)null; menu.Active = Convert.ToBoolean(rdr["Active"]); listMenu.Add(menu); } } List<Menu> menuTree = GetMenuTree(listMenu, null); JavaScriptSerializer js = new JavaScriptSerializer(); context.Response.Write(js.Serialize(menuTree)); } public List<Menu> GetMenuTree(List<Menu> list, int? parent) { return list.Where(x => x.ParentId == parent).Select(x => new Menu { Id = x.Id, MenuText = x.MenuText, ParentId = x.ParentId, Active = x.Active, List = GetMenuTree(list, x.Id) }).ToList(); } public bool IsReusable { get { return false; } } } } HTML & jQuery code <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Demo.WebForm1" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script src="jquery-1.11.2.js"></script> <script src="jquery-ui.js"></script> <link href="jquery-ui.css" rel="stylesheet" /> <script type="text/javascript"> $(document).ready(function () { $.ajax({ url: 'MenuHandler.ashx', method: 'get', dataType: 'json', success: function (data) { buildMenu($('#menu'), data); $('#menu').menu(); }, error: function (err) { alert(err.statusText); } }); function buildMenu(parent, items) { $.each(items, function () { var li = $("<li>" + this.MenuText + "</li>"); if (!this.Active) { li.addClass('ui-state-disabled'); } li.appendTo(parent); if (this.List && this.List.length > 0) { var ul = $("<ul></ul>"); ul.appendTo(li); buildMenu(ul, this.List); } }); } }); </script> </head> <body style="font-family: Arial"> <form id="form1" runat="server"> <div style="width: 150px"> <ul id="menu"> </ul> </div> </form> </body> </html>
Views: 37900 kudvenkat
jQuery get selected checkbox text
 
09:04
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/jquery-get-selected-checkbox-text.html In this video we will discuss how to get the checked checkbox text along with the value. This is continuation to Part 12, please watch Part 12 from jQuery tutorial before proceeding. Here is what we want to do. As we check the checkboxes, we want to display the count of checkboxes checked and their text and values. Replace < with LESSTHAN symbol and > with GREATERTHAN symbol. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('input[name="skills"]').click(function () { getSelectedCheckBoxes('skills'); }); $('input[name="cities"]').click(function () { getSelectedCheckBoxes('cities'); }); var getSelectedCheckBoxes = function (groupName) { var result = $('input[name="' + groupName + '"]:checked'); if (result.length > 0) { var resultString = result.length + " checkbox checked<br/>"; result.each(function () { var selectedValue = $(this).val(); resultString += selectedValue + " - " + $('label[for="option-' + selectedValue + '"]').text() + "<br/>"; }); $('#div' + groupName).html(resultString); } else { $('#div' + groupName).html("No checkbox checked"); } }; }); </script> </head> <body style="font-family:Arial"> Skills : <input type="checkbox" name="skills" value="js" /> <label for="option-js">JavaScript</label> <input type="checkbox" name="skills" value="jq" /> <label for="option-jq">jQuery</label> <input type="checkbox" name="skills" value="cs" /> <label for="option-cs">C#</label> <input type="checkbox" name="skills" value="vb" /> <label for="option-vb">VB</label> <br /><br /> Preferred Cities : <input type="checkbox" name="cities" value="ny" /> <label for="option-ny">New York</label> <input type="checkbox" name="cities" value="nd" /> <label for="option-nd">New Delhi</label> <input type="checkbox" name="cities" value="ln" /> <label for="option-ln">London</label> <br /><br /> Selected Skills:<br /> <div id="divskills"></div> <br /> Selected Cities:<br /> <div id="divcities"></div> </body> </html>
Views: 73227 kudvenkat
jQuery disabled selector
 
04:29
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/jquery-disabled-selector.html In this video we will discuss 1. jQuery disabled selector 2. jQuery enabled selector 3. Where you can find jquery selectors documentation Selects all disabled elements $(':disabled') Selects all disabled elements and sets a 3px solid red border [html] [head] [title][/title] [script src="jquery-1.11.2.js"][/script] [script type="text/javascript"] $(document).ready(function () { $(':disabled').css('border', '3px solid red'); }); [/script] [/head] [body style="font-family:Arial"] [table] [tr] [td]First Name [/td] [td][input type="text" disabled="disabled" /][/td] [/tr] [tr] [td]Last Name [/td] [td][input type="text" disabled="disabled" /][/td] [/tr] [tr] [td]Email [/td] [td][input type="text" /][/td] [/tr] [tr] [td]Gender [/td] [td] [select id="selectGender" disabled="disabled"] [option value="Male"]Male[/option] [option value="Female"]Female[/option] [/select] [/td] [/tr] [tr] [td]Comments[/td] [td][textarea][/textarea][/td] [/tr] [tr] [td colspan="2"] [input type="submit" value="Submit" disabled="disabled"/] [/td] [/tr] [/table] [/body] [/html] Selects all input elements that are disabled and sets a 3px solid red border [script type="text/javascript"] $(document).ready(function () { $('input:disabled').css('border', '3px solid red'); }); [/script] Selects all input elements with type=text that are disabled and sets a 3px solid red border [script type="text/javascript"] $(document).ready(function () { $('input[type="text"]:disabled').css('border', '3px solid red'); }); [/script] Selects all enabled elements $(':enabled') Selects all enabled textarea elements and sets a 3px solid red border [script type="text/javascript"] $(document).ready(function () { $('textarea:enabled').css('border', '3px solid red'); }); [/script] Where can you find jquery selectors documentation https://api.jquery.com/category/selectors
Views: 54749 kudvenkat
jquery animate function
 
12:26
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/05/jquery-animate-function.html jQuery animate function let's us animate CSS properties. The following example animates the div element, while changing the font-size property of the div element from its initial size to 50 pixels over a period of 2000 milli-seconds (2 seconds). <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#myButton').click(function () { $('#myDiv').animate({ 'font-size': '50' }, 2000); }); }); </script> </head> <body style="font-family:Arial"> <input type="button" id="myButton" value="Animate" /> <br /><br /> <div id="myDiv"> jQuery animate function </div> </body> </html> Syntax of jquery animate function .animate( properties [, duration ] [, easing ] [, complete ] ) Animate function has 4 parameters. Only the first parameter (properties) is the required parameter. Rest 3 are optional. properties - An object of CSS properties and values duration - The duration for animation in milliseconds. Default is 400. easing - Easing function to use for the transition. Default is swing. You could also use linear. complete - A function to call once the animation is complete What is jQuery easing Easing is a technique where the speed and/or direction of animation are changed while the animation is in progress. Easing can make the animation start off slow and gradually speed up, start up fast and gradually slow down, and a whole host of other effects. The difference between linear and swing easing is very subtle. The following page shows all the easings provided by jQuery UI https://jqueryui.com/easing The following example increases the height and width of the image to 400 pixels on mouseover. On mouseout the height and width are reduced to 100 pixels. <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#myImage').on({ mouseover: function () { $(this).animate({ 'height': 400, 'width': 400, }, 3000); }, mouseout: function () { $(this).animate({ 'height': 100, 'width': 100, }, 3000); } }); }); </script> </head> <body style="font-family:Arial"> <img id="myImage" height="100" width="100" src="/Images/Tulips.jpg" /> </body> </html> In the following example, several calls to animate() method are chained together. By default these calls are placed into a queue to be executed one after the other in series rather than executing all of them simultaneously in parallel. <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#myImage').click(function () { $(this) .animate({ 'left': '300' }) .animate({ 'top': '200' }) .animate({ 'left': '10' }) .animate({ 'top': '10' }); }); }); </script> </head> <body style="font-family:Arial"> <img id="myImage" height="100" width="100" style="position:absolute" src="/Images/Tulips.jpg" /> </body> </html> Please note: By default, all HTML elements have a static position, and cannot be moved. To modify the position , set the CSS position property of the element to fixed, absolute or relative.
Views: 40927 kudvenkat
jQuery event delegation
 
07:37
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/05/jquery-event-delegation.html In this video we will discuss the concept of event delegation in jQuery. Event delegation allows us to attach a single event listener, to a parent element, that will fire for all descendants matching a selector, whether those descendants exist now or are added in the future. Both on() and delegate() functions allow us to perform event delegation. How does the following example work : 1. When you click on a list item (li), the event gets bubbled up to its parent (ul) as the list item (li) does not have it's own click event handler 2. The bubbled event is handled by the the parent (ul) element, as it has a click event handler. 3. When a new list item is added dynamicaly, you don't have to add the click event handler explicitly to it. Since the newly created list item (li) is added to the same parent element (ul), the click event of this list item also gets bubbled upto the same parent and will be handled by it. 4. undelegate() stops event delegation <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('ul').delegate('li', 'click', function () { $(this).fadeOut(500); }); $('#btnAdd').on('click', function () { $('ul').append('<li>New List Item</li>'); }); $('#btnUndelegate').on('click', function () { $('ul').undelegate('li', 'click'); }); }); </script> </head> <body style="font-family:Arial"> <input id="btnAdd" type="button" value="Add a New List Item" /> <input id="btnUndelegate" type="button" value="Undelegate" /> <ul> <li>List Item</li> <li>List Item</li> </ul> </body> </html> If you are using jQuery 1.7 or higher version, jQuery recommends to use on() to perform event delegation instead of delegate(). The above example can be very easily rewritten using on() and off() functions, instead of delegate() and undelegate() functions as shown below. We discussed performing event delegation using on() function in detail in Part 36 of jQuery tutorial. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('ul').on('click', 'li', function () { $(this).fadeOut(500); }); $('#btnAdd').on('click', function () { $('ul').append('<li>New List Item</li>'); }); $('#btnUndelegate').on('click', function () { $('ul').off('click', 'li'); }); }); </script> </head> <body style="font-family:Arial"> <input id="btnAdd" type="button" value="Add a New List Item" /> <input id="btnUndelegate" type="button" value="Undelegate" /> <ul> <li>List Item</li> <li>List Item</li> </ul> </body> </html>
Views: 35873 kudvenkat
jQuery add event handler to dynamically created element
 
09:15
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/jquery-add-event-handler-to-dynamically.html In this video we will discuss, how to add event handlers to dynamically created elements. Let us understand this with an example. The following example, allows us to dynamically create new list item (li), attach a click event handler and add it to the unordered list (ul). This happens when you click "Add a New List Item" button. The problem with this approach is that we are binding a click event handler to every list item. This means if you have 500 list items, then there will be 500 event handlers in the memory and this may negatively affect the performance of your application. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('li').on('click', function () { $(this).fadeOut(500); }); $('#btnAdd').on('click', function () { var newListItem = $('<li>New List Item</li>').on('click', function () { $(this).fadeOut(500); }); $('ul').append(newListItem); }); }); </script> </head> <body style="font-family:Arial"> <input id="btnAdd" type="button" value="Add a New List Item" /> <ul> <li>List Item</li> <li>List Item</li> </ul> </body> </html> A better way of doing the same from a performance standpoint is shown below. In this example, the click event handler is attached to the listitem (li) parent element (ul). Even if you have 500 list items, there is only one click event handler in memory. So how does this work 1. When you click on a list item (li), the event gets bubbled up to its parent (ul) as the list item (li) does not have an event handler 2. The bubbled event is handled by the the parent (ul) element, as it has a click event handler. 3. When a new list item is added dynamicaly, you don't have to add the click event handler to it. Since the newly created list item (li) is added to the same parent element (ul), the click event of this list item also gets bubbled upto the same parent and will be handled by it. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('ul').on('click', 'li', function () { $(this).fadeOut(500); }); $('#btnAdd').on('click', function () { $('ul').append('<li>New List Item</li>'); }); }); </script> </head> <body style="font-family:Arial"> <input id="btnAdd" type="button" value="Add a New List Item" /> <ul> <li>List Item</li> <li>List Item</li> </ul> </body> </html>
Views: 61741 kudvenkat
Simple jquery progress bar
 
11:05
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/05/simple-jquery-progress-bar.html In this video we will discuss how to create a simple animated jquery progress bar using animate() function. Replace < with LESSTHAN symbol and > with GREATERTHAN symbol <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#myButton').click(function () { animateProgressBar($('#ddlPercent').val()); }); function animateProgressBar(percentComplete) { $('#innerDiv').animate({ 'width': (500 * percentComplete) / 100 }, 2000); $({ counter: 1 }).animate({ counter: percentComplete }, { duration: 2000, step: function () { $('#innerDiv').text(Math.ceil(this.counter) + ' %'); } }); } }); </script> </head> <body style="font-family:Arial"> Select percentage : <select id="ddlPercent"> <option value="10">10</option> <option value="20">20</option> <option value="30">30</option> <option value="40">40</option> <option value="50">50</option> <option value="60">60</option> <option value="70">70</option> <option value="80">80</option> <option value="90">90</option> <option value="100">100</option> </select> <input type="button" id="myButton" value="Start Animation" /> <br /><br /> <div id="outerDiv" style="background-color:#EEEEEE; height:20px; width:500px; padding:5px"> <div id="innerDiv" style="width:0px; height:19px; text-align:center; background-color:red; color:white"></div> </div> </body> </html>
Views: 40428 kudvenkat
jQuery preventdefault
 
05:49
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/05/jquery-preventdefault.html In this video we will discuss how to prevent browser default action using jQuery. First let's look at some of the browser default actions. For example, 1. When you right click on a web page, the browser displays the context menu 2. When you click on a link, the browser navigates to the page specified in the link In some situations you may want to prevent these default actions of the browser. For example some of the websites prevent you from right clicking on the page. Disabling right click is annoying users. Many people say they disabled right click for security, because they do not want their content to be copied. But if you disable JavaScript in the browser, you will still be able to right click and copy the content. So you are achieving nothing by disabling right click. Having said that, now let us see how to prevent the context menu from appearing when you right click on the web page. We discussed how to achieve this using raw JavaScript in Part 43 of JavaScript Tutorial. Let us now discuss, how to achieve this using jQuery Replace < with LESSTHAN symbol and > with GREATERTHAN symbol <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $(this).on('contextmenu', function (e) { e.preventDefault(); $('#divResult').append('Right click disabled<br/>') }); }); </script> </head> <body style="font-family:Arial"> <h3> Right click disabled on this page. Try to right click and see what happens </h3> <div id="divResult"></div> </body> </html> When you click on a link, how to prevent the browser from navigating to the page specified in the link. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#myHyperLink').on('click', function (e) { e.preventDefault(); $('#divResult').append('Hyperlink default action prevented<br/>') }); }); </script> </head> <body style="font-family:Arial"> <a id="myHyperLink" href="http://pragimtech.com"> Clicking on the link will not take you to PragimTech </a> <br /><br /> <div id="divResult"></div> </body> </html>
Views: 29885 kudvenkat
JavaScript Animated. How To Embed New Custom Fonts
 
04:23
This tutorial shows how to embed new fonts in JS Animated templates. More Premium JavaScript Website Themes you may find here: http://www.templatemonster.com/completely-javascript-website-templates/?utm_source=youtube&utm_medium=link&utm_campaign=cjstuts41 And also HTML 5 plus Javascript Templates: http://www.templatemonster.com/html-javascript-website-templates/?utm_source=youtube&utm_medium=link&utm_campaign=jshtuts41
Views: 140 TemplateMonster
jquery execute event only once
 
08:40
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/05/jquery-execute-event-only-once.html In this video we will discuss how to execute event of an element only once. Let us understand this with an example. Every time you click the button, you will get the JavaScript alert. $(document).ready(function () { $('#btn').on('click', function () { alert('Button Clicked'); }); }); If you want to execute the click event handler only once, then you will have to explicitly remove the click event handler. The following example removes the click event handler using off() function, after the alert is displayed. $(document).ready(function () { $('#btn').on('click', function () { alert('Button Clicked'); $(this).off('click'); }); }); jQuery one() function does exactly the same thing. The click event is raised only once. On the first click, JavaScript alert is displayed, but on subsequent clicks nothing happens. $(document).ready(function () { $('#btn').one('click', function () { alert('Button Clicked'); }); }); The following example binds 3 events(mouseover, mouseout, click) using on() function. If we want all these 3 events to execute only once, then we have to explicitly remove each event after first execution using off() method. $(document).ready(function () { $('#btn').on({ mouseover: function () { $(this).css('background-color', 'yellow'); $(this).off('mouseover'); }, mouseout : function() { $(this).css('background-color', 'white'); $(this).off('mouseout'); }, click : function() { alert('Button clicked'); $(this).off('click'); } }); }); The above example can be rewritten using one() function as shown below. $(document).ready(function () { $('#btn').one({ mouseover: function () { $(this).css('background-color', 'yellow'); }, mouseout : function() { $(this).css('background-color', 'white'); }, click : function() { alert('Button clicked'); } }); }); one() function executes the handler at most once per element per event type. In the following example, click, mouseover and mouseount events are executed atmost once for each button element. Replace < with LESSTHAN symbol and > with GREATERTHAN symbol <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('input[type="button"]').one({ mouseover: function () { $(this).css('background-color', 'yellow'); }, mouseout: function () { $(this).css('background-color', 'white'); }, click: function () { alert('Button clicked'); } }); }); </script> </head> <body style="font-family:Arial"> <input type="button" value="Click Me" /> <input type="button" value="Click Me" /> </body> </html>
Views: 28479 kudvenkat
Convert JSON object to string
 
07:47
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/convert-json-object-to-string.html In this video we will discuss 1. How to convert JSON object to string 2. How to convert string to JSON object This is continuation Part 18. Please watch Part 18 from jQuery tutorial before proceeding. Replace < with LESSTHAN symbol and > with GREATERTHAN symbol The following example converts JSON array to a string. JSON.stringify() method converts a JSON object (or array) into a string. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var employeesJSON = [ { "firstName": "Todd", "lastName": "Grover", "gender": "Male", "salary": 50000 }, { "firstName": "Sara", "lastName": "Baker", "gender": "Female", "salary": 40000 } ]; var JSONString = JSON.stringify(employeesJSON); $('#resultDiv').html(JSONString); }); </script> </head> <body style="font-family:Arial"> <div id="resultDiv"></div> </body> </html> Output : [{"firstName":"Todd","lastName":"Grover","gender":"Male","salary":50000}, {"firstName":"Sara","lastName":"Baker","gender":"Female","salary":40000}] The following example converts a string to a JSON array. JSON.parse() method converts a JSON string to JSON array. We then use the jQuery each() method to loop thru each employee JSON object and retrieve the respective property values. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var JSONString = '[{ "firstName": "Todd", "lastName": "Grover", "gender": "Male", "salary": 50000 }, { "firstName": "Sara", "lastName": "Baker", "gender": "Female", "salary": 40000 }]'; var employeesJSON = JSON.parse(JSONString); var result = ''; $.each(employeesJSON, function (i, item) { result += 'First Name = ' + item.firstName + '<br/>'; result += 'Last Name = ' + item.lastName + '<br/>'; result += 'Gender = ' + item.gender + '<br/>'; result += 'Salary = ' + item.salary + '<br/><br/>'; }); $('#resultDiv').html(result); }); </script> </head> <body style="font-family:Arial"> <div id="resultDiv"></div> </body> </html>
Views: 103558 kudvenkat
CSS Dasar - 4 - Font Styling
 
12:45
Font merupakan elemen pada halaman web yang berhubungan dengan typeface (jenis tulisan / huruf), bisa mengenai family-nya, ukuran, bold atau tidaknya dan lain-lain. Pada video kali ini, akan dibahas mengenai bagaimana memberikan style css terhadap font tersebut. -- BGM : "Time Immemorial" by. Chris Davidson http://freeplaymusic.com/volumedetail.aspx?volume=1568 -- Jangan lupa untuk follow juga akun media sosial kita yang lain : - https://www.facebook.com/WebProgrammingUNPAS - http://twitter.com/pw1unpas - http://instagram.com/webprogrammingunpas - http://codepen.io/webprogrammingunpas - http://www.unpas.ac.id terimakasih dan selamat #ngoding! @sandhikagalih
Views: 32192 Web Programming UNPAS
jQuery how to check if event is already bound
 
13:14
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/05/jquery-how-to-check-if-event-is-already.html In this video we will discuss, how to check if an event is already bound using jQuery. Why is it important to check if an event is already bound To prevent attaching event handler multiple times The following example checks if a click event handler is already bound. If it's not already bound, then a click event handler is attached. Replace < with LESSTHAN symbol and > with GREATERTHAN symbol <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var jQueryObject = $('#btn'); var rawDOMElement = jQueryObject.get(0); var eventObject = $._data(rawDOMElement, 'events'); if (eventObject != undefined && eventObject.click != undefined) { alert('Click event exists'); } else { $('#btn').on('click', function () { alert('Button Clicked'); }); } }); </script> </head> <body style="font-family:Arial"> <input id="btn" type="button" value="Click Me" /> </body> </html> Please note that this only works if you have attached event handlers using jQuery. This will not work if you have attached event handlers using raw JavaScript or element attributes. Another way to prevent attaching event handlers multiple times is by using jQuery off() and on() methods. The off() method ensures that all existing click event handlers of the button are removed before again adding a new click event handler using on() method. $('#btn').off('click').on('click', function () { alert('Button Clicked'); });
Views: 28805 kudvenkat
jquery floating div
 
13:36
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/05/jquery-floating-div.html In this video we will discuss, how to create floating div using jQuery. We want the div element in the sidebar to be floating and always visible as we scroll down the page. Example : In this example we are using position() and scrollTop() functions. The object returned by position() function has top and left properties, which can be used to know the current top and left positions (coordinates). We are using this function to find the top position of the div element that we want to keep floating as we scroll down. To get the current vertical position of the scroll bar, we are using scrollTop() function. As we scroll and when the current vertical position of the scroll bar becomes GREATER THAN the top position of the div element, then we want the div element to start floating. To do this set position style to fixed. A fixed position element is positioned relative to the browser window. So as you scroll down it will be floating in the browser window. If the current vertical position of the scroll bar becomes LESS THAN the top position of the div element, then we don't want the div element to float, so we set position style to relative. A relative position element is positioned relative to itself. So if you set position to relative and top to 0, it will continue to stay where it is without floating. <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var floatingDiv = $("#divfloating"); var floatingDivPosition = floatingDiv.position(); $(window).scroll(function () { var scrollPosition = $(window).scrollTop(); if (scrollPosition >= floatingDivPosition.top) { floatingDiv.css({ 'position': 'fixed', 'top' : 3 }); } else { floatingDiv.css({ 'position': 'relative', 'top' : 0 }); } }); }); </script> </head> <body style="font-family:Arial;"> <table align="center" border="1" style="border-collapse:collapse"> <tr> <td style="width:500px"> Main Page Content </td> <td style="width:150px; vertical-align:top"> Side panel content <br /><br /> <div id="divfloating" style="background-color:silver; width:150px; height:150px"> Floating Div - Keeps floating as you scroll down the page </div> </td> </tr> </table> </body> </html>
Views: 31160 kudvenkat
Font Style and Font Weight Property in CSS   --  Telugu 19-vlr training
 
03:29
Font Style and Font Weight Property in CSS -- Telugu 19 For Telugu https://www.youtube.com/watch?v=KDFa7jz4R54 For English https://www.youtube.com/watch?v=dExyH3sJthI FaceBook Page https://www.facebook.com/HtmlandCssTrainingInTeluguEnglish CSS font-weight property CSS text-align property CSS font-style property font-weight - CSS font-weight | CSS-Tricks CSS Property: font-weight CSS: font-weight property CSS/Properties/font-weight Font Weight font-weight - SitePoint CSS Reference css font weight thinner css font weight bold italic css font weight extra light css font weight semibold css font weight lighter not working Font Properties | CSS Basics Web Fonts with @font-face | CSS Basics CSS Font Family - YouTube CSS Tutorial for Beginners -The Font Weight Property .. CSS how to: font weight - YouTube Font style and font weight from the Course CSS: Core ... CSS Font (font-family property) - YouTube The Font Property | CSS Foundations CSS Font Styles XHTML and CSS Tutorial - 18 - font-weight font-style - Video CSS Core Concepts Font style and font weight - YouTube KeyWords. htmlcsstelugu,htmlcssenglish,telugu,english,cs s,html,html5,css3,training,hc58371,videos,how to,learn, Learn HTML online Learn HTML5 online How to Learn HTML5 How to Learn HTML HTML Training videos in Telugu HTML Training in Telugu Telugu HTML Training videos Telugu Training videos Youtube videos for HTML Telugu Web-Design Training videos Web-Design in Telugu HTML Training videos in English HTML Training in English English HTML Training videos English Training videos English Web-Design Training videos Web-Design in English Learn CSS online Learn CSS3 online How to Learn CSS3 How to Learn CSS CSS Training videos in English CSS Training in English English CSS Training videos Youtube videos for CSS CSS Training videos in Telugu CSS Training in Telugu Telugu CSS Training videos
Views: 949 VLR Training
jQuery to detect which mouse button clicked
 
08:33
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/04/jquery-to-detect-which-mouse-button.html In this video we will discuss, how to detect which mouse button is clicked using jQuery. With raw JavaScript event object : Depending on the browser, event.button or event.which properties of the event object are used to determine which mouse button is clicked. IE 8 & earlier versions use event.button property Left Button 1 Middle Button 4 Right Button 2 IE 9 & later versions and most other W3C compliant browsers use event.which property Left Button 1 Middle Button 2 Right Button 3 If you are using raw JavaScript event object, the following is the amount of code that you have to write to detect which mouse button is clicked. This code works in all browsers. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> function whichMouseButtonClicked(event) { var whichButton; if (event.which) { switch (event.which) { case 1: whichButton = "Left Button Clicked"; break; case 2: whichButton = "Middle Button Clicked"; break; case 3: whichButton = "Right Button Clicked"; break; default: whichButton = "Invalid Button Clicked"; break; } } else { switch (event.button) { case 1: whichButton = "Left Button Clicked"; break; case 4: whichButton = "Middle Button Clicked"; break; case 2: whichButton = "Right Button Clicked"; break; default: whichButton = "Invalid Button Clicked"; break; } } document.getElementById('divResult').innerHTML = whichButton; } </script> </head> <body style="font-family:Arial"> <input id="btn" type="button" value="Click Me" onmouseup="whichMouseButtonClicked(event)" /> <br /><br /> <div id="divResult"></div> </body> </html> jQuery normalizes which property of the event object so it will work across all browsers. The amount of code you have to write is lot less. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#btn').mouseup(function (event) { switch (event.which) { case 1: whichButton = "Left Button Clicked"; break; case 2: whichButton = "Middle Button Clicked"; break; case 3: whichButton = "Right Button Clicked"; break; default: whichButton = "Invalid Button Clicked"; break; } $('#divResult').html(whichButton); }); }); </script> </head> <body style="font-family:Arial"> <input id="btn" type="button" value="Click Me" /> <br /><br /> <div id="divResult"></div> </body> </html>
Views: 31637 kudvenkat
jquery ajax load
 
14:08
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/05/jquery-ajax-load.html In this video we will discuss how to load HTML data from the server using jquery AJAX load function. What is AJAX AJAX stands for Asynchronous JavaScript and XML, and allow parts of the page to be updated without having to reload the entire page. Syntax .load( url [, data ] [, complete ] ) Parameter - Description url - Required. URL to which the request is sent. data - Optional. A JSON object or string that is sent to the server along with the request. complete - A callback function that is called when the request completes. The following example loads HTML data from the server. When a text box receives focus, the help text associated with that field is loaded from the server and displayed. When the focus is lost the help text disappears. HtmlPage1.html <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var textBoxes = $('input[type="text"]'); textBoxes.focus(function () { var helpDiv = $(this).attr('id') + 'HelpDiv'; $('#' + helpDiv).load('Help.html #' + helpDiv); }); textBoxes.blur(function () { var helpDiv = $(this).attr('id') + 'HelpDiv'; $('#' + helpDiv).html(''); }); }); </script> </head> <body style="font-family:Arial"> <table> <tr> <td>First Name</td> <td><input id="firstName" type="text" /></td> <td><div id="firstNameHelpDiv"></div></td> </tr> <tr> <td>Last Name</td> <td><input id="lastName" type="text" /></td> <td><div id="lastNameHelpDiv"></div></td> </tr> <tr> <td>Email</td> <td><input id="email" type="text" /></td> <td><div id="emailHelpDiv"></div></td> </tr> <tr> <td>Income</td> <td><input id="income" type="text" /></td> <td><div id="incomeHelpDiv"></div></td> </tr> </table> </body> </html> Help.html <div id="firstNameHelpDiv"> Your fisrt name as it appears in passport </div> <div id="lastNameHelpDiv"> Your last name as it appears in passport </div> <div id="emailHelpDiv"> Your email address for communication </div> <div id="incomeHelpDiv"> Your annual income </div>
Views: 79221 kudvenkat
oct 06 typefont
 
33:26
Goes in the head of your page (lessthan)script type="text/javascript" src="http://use.typekit.com/xxxxx.js"(greaterthan)(lessthan)/script(greatterthan) (lessthan)script type="text/javascript"(greaterthan)try{Typekit.load();}catch(e){}(lessthan)/script(greaterthan) insert(greaterthan)HTML (lessthan)p style="font-family: 'Roboto', sans-serif;"(greaterthan) text goes here(lessthan)/p(greaterthan)
Views: 39 CNA GraphicDesign
jquery show hide password
 
11:01
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/05/jquery-show-hide-password.html In this video we will discuss how to toggle password visibility using show / hide password checkbox. Here is what we want to achieve 1. When Show password checkbox IS NOT CHECKED, the password should be masked 2. When Show password checkbox IS CHECKED, the password should be in clear text and visible to the user One of the simplest ways of achieving this is by changing the type attribute of the password field depending on the checked status of Show password checkbox 1. If the Show password checkbox is CHECKED change the type to text 2. If the Show password checkbox is NOT CHECKED change the type to password Replace < with LESSTHAN symbol and > with GREATERTHAN symbol The following is the HTML and jQuery code <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#cbShowPassword').click(function () { $('#txtPassword').attr('type', $(this).is(':checked') ? 'text' : 'password'); }); }); </script> </head> <body style="font-family:Arial"> Password : <input type="password" id="txtPassword" /> <input type="checkbox" id="cbShowPassword" />Show password </body> </html> The problem with the above approach is that it does not work in IE 8 and earlier versions. This is because with IE8 and earlier versions the type attribute of input elements cannot be changed once set. The following code works in all browsers including IE8 and earlier versions. When Show password checkbox is clicked 1. Retrieve the value the from the password textbox and store it in a variable for later use. 2. Delete the password input filed. 3. If the "Show password" checkbox is CHECKED, then add a new input filed of type text, else add a new input filed of password. In both the cases set the value attribute of the input element = the variable created in Step 1. <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#cbShowPassword').click(function () { var currentPassowrdFiled = $('#txtPassword'); var currentPassword = currentPassowrdFiled.val(); currentPassowrdFiled.remove(); if ($(this).is(':checked')) { $(this).before('<input type="text" id="txtPassword" value="' + currentPassword + '">'); } else { $(this).before('<input type="password" id="txtPassword" value="' + currentPassword + '">'); } }); }); </script> </head> <body style="font-family:Arial"> Password : <input type="password" id="txtPassword" /> <input type="checkbox" id="cbShowPassword" />Show password </body> </html>
Views: 26896 kudvenkat
Calling asp net web services using jquery ajax
 
15:44
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/06/calling-aspnet-web-services-using.html In this video we will discuss how to call asp.net webservice using jQuery AJAX. We want to retrieve data from the following database table tblEmployee using asp.net web service and jQuery AJAX Step 1 : Create SQL Server table and insert employee data Step 2 : Create a stored procedure to retrieve employee data by ID Step 3 : Create new asp.net web application project. Name it Demo. Step 4 : Include a connection string in the web.config file to your database. Step 5 : Add a class file to the project. Name it Employee.cs. Copy and paste the following code. namespace Demo { public class Employee { public int ID { get; set; } public string Name { get; set; } public string Gender { get; set; } public int Salary { get; set; } } } Step 6 : Add a new WebService (ASMX). Name it EmployeeService.asmx. Copy and paste the following code. using System; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Web.Services; namespace Demo { [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] [System.Web.Script.Services.ScriptService] public class EmployeeService : System.Web.Services.WebService { [WebMethod] public Employee GetEmployeeById(int employeeId) { Employee employee = new Employee(); string cs = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; using (SqlConnection con = new SqlConnection(cs)) { SqlCommand cmd = new SqlCommand("spGetEmployeeById", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter parameter = new SqlParameter(); parameter.ParameterName = "@Id"; parameter.Value = employeeId; cmd.Parameters.Add(parameter); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while(rdr.Read()) { employee.ID = Convert.ToInt32(rdr["Id"]); employee.Name = rdr["Name"].ToString(); employee.Gender = rdr["Gender"].ToString(); employee.Salary = Convert.ToInt32(rdr["Salary"]); } } return employee; } } } Step 6 : Add an HTML page to the ASP.NET project. Copy and paste the following HTML and jQuery code <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('#btnGetEmployee').click(function () { var empId = $('#txtId').val(); $.ajax({ url: 'EmployeeService.asmx/GetEmployeeById', data: { employeeId: empId }, method: 'post', dataType: 'xml', success: function (data) { var jQueryXml = $(data); $('#txtName').val(jQueryXml.find('Name').text()); $('#txtGender').val(jQueryXml.find('Gender').text()); $('#txtSalary').val(jQueryXml.find('Salary').text()); }, error: function (err) { alert(err); } }); }); }); </script> </head> <body style="font-family:Arial"> ID : <input id="txtId" type="text" style="width:100px" /> <input type="button" id="btnGetEmployee" value="Get Employee" /> <br /><br /> <table border="1" style="border-collapse:collapse"> <tr> <td>Name</td> <td><input id="txtName" type="text" /></td> </tr> <tr> <td>Gender</td> <td><input id="txtGender" type="text" /></td> </tr> <tr> <td>Salary</td> <td><input id="txtSalary" type="text" /></td> </tr> </table> </body> </html> In our next video we will discuss how to call an asp.net web service that returns JSON data using jQuery AJAX.
Views: 59847 kudvenkat
Handling events in AngularJS
 
07:57
event handling in angularjs angularjs ng click example angularjs ng click event In this video we will discuss how to handle events in AngularJS. Let us understand with an example. Here is what we want to do. 1. Display the list of technologies in a table 2. Provide the ability to ike and dislike a technology 3. Increment the likes and dislikes when the respective buttons are clicked Script.js : In the controller function we have 2 methods to increment likes and dislikes. Both the functions have the technology object that we want to like or dislike as a parameter. var app = angular .module("myModule", []) .controller("myController", function ($scope) { var technologies = [ { name:"C#", likes:0, dislikes:0 }, { name: "ASP.NET", likes: 0, dislikes: 0 }, { name: "SQL", likes: 0, dislikes: 0 }, { name: "AngularJS", likes: 0, dislikes: 0 } ]; $scope.technologies = technologies; $scope.incrementLikes = function (technology) { technology.likes++; }; $scope.incrementDislikes = function (technology) { technology.dislikes++; }; }); HtmlPage1.html : Notice in the html below, we are associating incrementLikes() and incrementDislikes() functions with the respective button. When any of these buttons are clicked, the corresponsing technology object is automatically passed to the function, and the likes or dislikes property is incremented depending on which button is clicked. [!DOCTYPE html] [html xmlns="http://www.w3.org/1999/xhtml"] [head] [title][/title] [script src="Scripts/angular.min.js"][/script] [script src="Scripts/Script.js"][/script] [link href="Styles.css" rel="stylesheet" /] [/head] [body ng-app="myModule"] [div ng-controller="myController"] [table] [thead] [tr] [th]Name[/th] [th]Likes[/th] [th]Dislikes[/th] [th]Like/Dislike[/th] [/tr] [/thead] [tbody] [tr ng-repeat="technology in technologies"] [td] {{ technology.name }} [/td] [td style="text-align:center"] {{ technology.likes }} [/td] [td style="text-align:center"] {{ technology.dislikes }} [/td] [td] [input type="button" ng-click="incrementLikes(technology)" value="Like" /] [input type="button" ng-click="incrementDislikes(technology)" value="Dislike" /] [/td] [/tr] [/tbody] [/table] [/div] [/body] [/html] Styles.css : Styles for table, td and th elements table { border-collapse: collapse; font-family:Arial; } td { border: 1px solid black; padding: 5px; } th { border: 1px solid black; padding: 5px; text-align: left; } Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/11/handling-events-in-angularjs.html
Views: 329188 kudvenkat
Select values of checkbox group with jquery
 
12:22
Link for all dot net and sql server video tutorial playlists https://www.youtube.com/user/kudvenkat/playlists?sort=dd&view=1 Link for slides, code samples and text version of the video http://csharp-video-tutorials.blogspot.com/2015/03/select-values-of-checkbox-group-with.html In this video we will discuss, how to select values of checked checkboxes that are in different groups using jQuery. Along the way, we will also discuss how to pass a variable to jquery selector. If you have just one group of checkboxes on your page, to get all the checked checkboxes you can use $('input[type="checkbox"]:checked'). However, if you have more than one checkbox group, then $('input[type="checkbox"]:checked') is going to select all checked checkboxes from both the checkbox groups. If you prefer to get checked checkboxes from a specific checkbox group, depending on which button you have clicked, you can use $('input[name="skills"]:checked') or $('input[name="cities"]:checked'). This will ensure that the checked checkboxes from only the skills or cities checkbox group are selected. Replace < with LESSTHAN symbol and > with GREATERTHAN symbol. At the moment to get the checked checkboxes values, we are using a button click event. You can also use the click event of the checkbox to do this. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { $('input[name="skills"]').click(function () { getSelectedCheckBoxes('skills'); }); $('input[name="cities"]').click(function () { getSelectedCheckBoxes('cities'); }); var getSelectedCheckBoxes = function (groupName) { var result = $('input[name="' + groupName + '"]:checked'); if (result.length > 0) { var resultString = result.length + " checkboxe(s) checked<br/>"; result.each(function () { resultString += $(this).val() + "<br/>"; }); $('#div' + groupName).html(resultString); } else { $('#div' + groupName).html("No checkbox checked"); } }; }); </script> </head> <body style="font-family:Arial"> Skills : <input type="checkbox" name="skills" value="JavaScript" />JavaScript <input type="checkbox" name="skills" value="jQuery" />jQuery <input type="checkbox" name="skills" value="C#" />C# <input type="checkbox" name="skills" value="VB" />VB <br /><br /> Preferred Cities : <input type="checkbox" name="cities" value="New York" />New York <input type="checkbox" name="cities" value="New Delhi" />New Delhi <input type="checkbox" name="cities" value="London" />London <br /><br /> Selected Skills:<br /> <div id="divskills"></div> <br /> Selected Cities:<br /> <div id="divcities"></div> </body> </html>
Views: 95386 kudvenkat

P2y2 assay plavix generic name
Hytrin nombre generico de morfina
Cymbalta 60 mg engordar
Facts about generic synthroid
Nombre generico de cialis for daily use