Home
Search results “Body style font family”
CSS Tutorial for Beginners - 02 - Changing font type, color, and size
 
04:06
In this video we go over changing the font type, size, and color. Source for episode: http://pastebin.com/RVK07MrM
Views: 392844 EJ Media
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: 22770 kudvenkat
CSS Tutorial - how to style body element in css
 
06:43
CSS Tutorial - how to style body element in css In this tutorial, I have shown how to style body element i.e., body background color, margin, font family, font size and font color using css as a separate file. CSS Tutorial - how to style body element in css Plz watch more Videos : https://www.youtube.com/channel/UCpC1aMr626OJvuYhVbsYySg Plz watch and share : https://youtu.be/jz0AE0YuFKs
Views: 59 ITbird143
WordPress tutorial: Changing font family styles | lynda.com
 
04:12
This WordPress tutorial shows how to change the fonts on your website by changing the CSS style sheet in your child theme. Watch more at http://www.lynda.com/WordPress-3-0-tutorials/WordPress-3-Building-Child-Themes/77859-2.html?utm_medium=viral&utm_source=youtube&utm_campaign=videoupload-web-dev-bGHTdCYvSWI. This tutorial is a single movie from the Start with a Theme: Magazine Styles in WordPress course presented by lynda.com author Morten Rand-Hendriksen. The complete course is 3 hours and 11 minutes long and shows how to create a child theme based on an existing parent theme in WordPress and change the functionality, presentation, or styling of a site "Introduction 1. Creating a Child Theme from Scratch 2. Modifying and Adding Styles 3. Modifying and Adding Templates 4. Customizing the Index Pages 5. Modifying and Adding Functions 6. Working with Featured Images 7. Beyond the Basics 8. Adding Finishing Touches 9. Troubleshooting Child Themes"
Views: 4448 LinkedIn Learning
CSS3 Tutorial for Beginners: 13 Adding Font Family Property
 
04:29
CSS3 Tutorial for Beginners: 13 Adding Font Family Property ★ SUMMARY ★ Today I want to share with you how to manipulate or modify the font family when it comes to your business website. I'm going to show you some of the generic fonts there are. And you are going to learn about the importance of hierarchy when it comes to the font-family property. I'll show you how to set different font types in order of priority, so that if your website's visitors don't have the first font type installed in their computer, then the second one will be used, or the third one, and so forth. Read the full post at https://backstageincome.com/blog/css3-13-font-family-property/ ★ TOOLS FOR THIS TUTORIAL ★ SublimeText: https://www.sublimetext.com/ Atom: https://atom.io/ Chrome : https://www.google.com/chrome/ Autorefresh plugins: https://chrome.google.com/webstore/search/auto%20refresh?hl=en-US ★ START & BUILD YOUR ONLINE BUSINESS ★ https://backstageincome.com/go/start/ ★ MY BUSINESS TOOLS ★ https://backstageincome.com/go/tools/ ★ MY CAMERA GEAR ★ https://backstageincome.com/go/vidtools/ ★ MY COMPUTER EQUIPMENT ★ https://backstageincome.com/go/computergear/ ★ SHARE THIS VIDEO ★ https://youtu.be/PrmR-eshh8c ★ SUBSCRIBE TO MY YOUTUBE: ★ http://bit.ly/getbackstage ★ ABOUT BACKSTAGE INCOME ★ On Backstage Income, we discuss how to build and grow yourself personally as well as your business. Income is not just about money - but about coming in and entering. Here we share how to grow the various moments coming into your life from your financial wealth, business, but also personal growth. If you are interested in exchanging ideas, want to contribute, or just have some thoughts to share - we'd love to have you subscribe and join us! BUSINESS COURSES: - https://backstageincome.com/go/bizcourses/ BUSINESS BOOKS: - https://backstageincome.com/go/bizbooks/ WEBSITES: - https://backstageincome.com - https://mylittlenestegg.com - https://rise2learn.com - https://tradersfly.com - https://sashaevdakov.com - https://criticalcharts.com SOCIAL MEDIA: - https://facebook.com/sashaevdakov - https://twitter.com/sevdakov MY YOUTUBE CHANNELS: - TradersFly: http://bit.ly/tradersfly - BackstageIncome: http://bit.ly/backstageincome
Views: 332 Sasha Evdakov
CSS Base Font Size Review
 
09:51
Just a quick re-overview on using Base Font sizes using CSS techniques.
Views: 609 The Art of Code
How to style the body tag and apply a background in HTML
 
02:43
style your body tag via CSS. Never suffer distorted background images again by learning how to properly use a background image via the ‘background-image’ and ‘background-size’ CSS rules. You’re also going to see exactly how to set font colors via the ‘color’ rule, font sizes via the ‘font-size’ rule, and text line spacing via the ‘line-height’ rule. Want to check out the full course? Go to www.hackstack.io for this and many others bite-sized tutorials that will help you do more, faster, with less.
Views: 907 HackStack.io
CSS - 08. Styling fonts: font-family and font-style
 
06:21
In this video, I talk about ways in which you can style fonts in CSS, using font-family and font-style.
Views: 271 Loot Tutorial
CSS Font Family
 
06:07
Check out my new site at http://www.youtubemuse.com/ In this screencast, we are going to talk about setting font family using CSS. If you've used rich text editing software like Microsoft Word before, then you should be familiar with fonts like Time New Roman or a lot of others you can choose from. I will show you some fonts that are more commonly used in the internet world.
Views: 3263 Jeffery Hirono
CSS3 Tutorial for Beginners: 11 Applying Font Size To a Body Element
 
05:42
CSS3 Tutorial for Beginners: 11 Applying Font Size To a Body Element ★ SUMMARY ★ Today I'm going to show you the different ways of changing the font size of your website elements using CSS. You'll learn how to change the font size using pixels, points, as well as percentages and em values, also you'll take a look at the effect that inheritance has on font size. And I'll show you what's the best and most efficient way of changing the size of your website's fonts. Read the full post at https://backstageincome.com/blog/css3-11-font-size-body-element/ ★ TOOLS FOR THIS TUTORIAL ★ SublimeText: https://www.sublimetext.com/ Atom: https://atom.io/ Chrome : https://www.google.com/chrome/ Autorefresh plugins: https://chrome.google.com/webstore/search/auto%20refresh?hl=en-US ★ START & BUILD YOUR ONLINE BUSINESS ★ https://backstageincome.com/go/start/ ★ MY BUSINESS TOOLS ★ https://backstageincome.com/go/tools/ ★ MY CAMERA GEAR ★ https://backstageincome.com/go/vidtools/ ★ MY COMPUTER EQUIPMENT ★ https://backstageincome.com/go/computergear/ ★ SHARE THIS VIDEO ★ https://youtu.be/PrmR-eshh8c ★ SUBSCRIBE TO MY YOUTUBE: ★ http://bit.ly/getbackstage ★ ABOUT BACKSTAGE INCOME ★ On Backstage Income, we discuss how to build and grow yourself personally as well as your business. Income is not just about money - but about coming in and entering. Here we share how to grow the various moments coming into your life from your financial wealth, business, but also personal growth. If you are interested in exchanging ideas, want to contribute, or just have some thoughts to share - we'd love to have you subscribe and join us! BUSINESS COURSES: - https://backstageincome.com/go/bizcourses/ BUSINESS BOOKS: - https://backstageincome.com/go/bizbooks/ WEBSITES: - https://backstageincome.com - https://mylittlenestegg.com - https://rise2learn.com - https://tradersfly.com - https://sashaevdakov.com - https://criticalcharts.com SOCIAL MEDIA: - https://facebook.com/sashaevdakov - https://twitter.com/sevdakov MY YOUTUBE CHANNELS: - TradersFly: http://bit.ly/tradersfly - BackstageIncome: http://bit.ly/backstageincome
Views: 185 Sasha Evdakov
Change the Font style, Color, size with css stylesheet on wordpress
 
04:28
Change the Font style, Color, size with css stylesheet on wordpress
Views: 107 Milvio LuA
CSS Font Size
 
03:38
Check out my new site at http://www.youtubemuse.com/ In this screencast, we are going to talk about setting font size using CSS.
Views: 3816 Jeffery Hirono
HTML Introduction: Part 5, Style Tag
 
04:39
Hello and Welcome to another session on HTML series. We have covered quite a lot in past four sessions which you may want to check out. In the earlier sessions, we started from the beginning of, what is HTML, to different tags, and associated attributes to tags in details like, IMG tag and its attributes, for embedding images in HTML document. In this session, we will consider another such attribute common in some tags, that is style attribute. Please note that to have hands on experience, modify the code accordingly. The HTML Style Attribute is for setting different styles of an HTML element. To apply style on supported HTML element, write the HTML element and define the style property as the syntax shown. Syntax - <tagname style="property:value;"> The property defines, what style is to be set for the HTML element. The property is something which is called CSS property or cascading style sheet. CSS is used to define all the style properties of HTML document. The value in style attribute is a CSS value. Let’s learn more about the style attribute, properties and values. HTML Background Color The background-color property defines the background color for an HTML element. The syntax is to define property background color as shown with value as any color Syntax - <tagname style="background-color:value;"> This example sets the background color for a page to powderblue: Example <body style="background-color:powderblue;"> HTML Text Color The color property defines the text color for an HTML element The syntax is to define property color as shown with value as any color Syntax - <tagname style="color:value;"> This example sets the color as blue for the header and paragraph. Example <h1 style="color: blue;">This is a heading</h1> <p style="color: red;">This is a paragraph. </p> HTML Fonts The font-family property defines the font to be used for an HTML element. The syntax is to define property font family as shown with value as any color Syntax - <tagname style="font-family:value;"> This example sets font as verdana and courier. Example <h1 style="font-family:verdana;">This is a heading</h1> <p style="font-family:courier;">This is a paragraph.</p> HTML Text Size The font-size property defines the text size for an HTML element. The syntax is to define property font size as shown with value as any color The syntax is to define property font size as shown with value as size Syntax - <tagname style="font-size:value;"> This example sets the header font size to 3 times and paragraph font size to 160 percent. Example <h1 style="font-size:300%;">This is a heading</h1> <p style="font-size:160%;">This is a paragraph.</p> HTML Text Alignment The text-align property defines the horizontal text alignment for an HTML element. The syntax is to define property text alignment as shown with value as center, left, right Syntax - <tagname style="text-align:value;"> This example sets the text alignment as center. Example <h1 style="text-align:center;">Centered Heading</h1> <p style="text-align:center;">Centered paragraph.</p> Well Done! You have learned to Use the style attribute for styling HTML elements, Use background-color for background color, Use color for text colors, Use font-family for text fonts, Use font-size for text sizes, and Use text-align for text. To find out more, visit links in the description. Which topic you want us to cover next. Share your thoughts in the comment section. Like and subscribe for more videos. Source: https://www.w3schools.com/html/html_styles.asp Code ------------------------------------ <html> <head> <title>HTML Introduction - Part 5 - Style Attribute</title> </head> <body style="background-color:powderblue;"> <h1 style="color:blue;">This heading is in color blue by style tag.</h1> <p style="color:red;">This paragraph is in red color by style tag.</p> <h1 style="font-family:verdana;">This heading's font is verdana</h1> <p style="font-family:courier;">This paragraph font is courier.</p> <h1 style="font-size:300%;">This heading font size is 3 times the normal heading.</h1> <p style="font-size:160%;">This paragraph font size is 1.6 time the normal font size.</p> <h1 style="text-align:center;">This Heading is in center <h1> <p style="text-align:center;">This paragraph is in center.</p> </body> </html> My Blogs https://azblogs4u.blogspot.com/ https://atozcreations4u.wixsite.com/insights PACIFIC SUN by Nicolai Heidlas Music https://soundcloud.com/nicolai-heidlas Creative Commons — Attribution 3.0 Unported— CC BY 3.0 http://creativecommons.org/licenses/b... Music promoted by Audio Library https://youtu.be/kbqmEJTr3nU
Views: 86 LEARNITIUM
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: 47418 kudvenkat
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: 30694 kudvenkat
How to change background color, font size, text color in Html.
 
05:55
How to change background color, font size, text color in Html.
Views: 65 Tech Updates
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: 51436 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: 45094 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: 39630 kudvenkat
jQuery scroll event
 
10:17
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-scroll-event.html In this video we will discuss scroll event and how to handle it using jQuery. scroll event is raised when the user scrolls to a different place in the element. It applies to window objects, but also to scrollable frames and elements with the overflow CSS property set to scroll. In the following exampe, notice that the div element overflow style is set to scroll. The div element has a scrollbar and as you scroll up and down the div element, the scroll event is raised and handled. 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 () { $('div').scroll(function () { $('h3').css('display', 'inline').fadeOut(1000); }); }); </script> </head> <body style="font-family:Arial"> <div style="width:300px; height:200px; border:1px solid black; overflow:scroll"> PRAGIM Speciality in training arena unlike other training institutions. Training delivered by real time software experts having more than 10 years of experience. Interview questions and real time scenarios discussion on topics covered for the day. Realtime projects discussion relating to the possible interview questions. Trainees can attend training and use lab untill you get a job. Resume preperation and mock up interviews. 100% placement assistance. 24 hours lab facility. PRAGIM Technologies offers professional real time projects for studetns in their final semester. Course completion and project completion certificates will also be provided upon successful completion of the course. We have partnered with major multinational companies to place freshers with our clients on their course completion. </div> <br /> <h3 style="display:none; color:red">Scroll event handled</h3> </body> </html> The following example, keeps track of how many times the scroll event is raised. <html> <head> <title></title> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var count = 0; $('div').scroll(function () { $('span').text(count += 1); }); }); </script> </head> <body style="font-family:Arial"> <div style="width:300px; height:200px; border:1px solid black; overflow:scroll"> DIV CONTENT </div> <br /> <h3 style="color:red">Scroll event handled <span>0</span> time(s)</h3> </body> </html> The following example, keeps track of whether the user scrolled up or down. <html> <head> <script src="jquery-1.11.2.js"></script> <script type="text/javascript"> $(document).ready(function () { var lastScrollTop = 0; $('div').scroll(function () { var currentScrollPosition = $(this).scrollTop(); if (currentScrollPosition > lastScrollTop) { $('h3').text('You scrolled down'); } else { $('h3').text('You scrolled up'); } lastScrollTop = currentScrollPosition; }); }); </script> </head> <body style="font-family:Arial"> <div style="width:300px; height:200px; border:1px solid black; overflow:scroll"> DIV CONTENT </div> <br /> <h3 style="display:inline; color:red"></h3> </body> </html>
Views: 47169 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: 43499 kudvenkat
CSS - Changing Font Family
 
01:58
In this tutorial, I show you how to change the 'font family' with CSS
Views: 292 TheMSTutorialsGuy
HTML and CSS Tutorial 12 : Stylizing Text font face, family, style, and size
 
07:41
. Visit Our Friends @ Stone River E-Learning for Additional Tutorials - http://bit.ly/1fjsXTn Coupon 20% Off HTML & CSS for Beginners - http://bit.ly/1MmuYfw
Views: 2686 mybringback
jquery droppable widget
 
10: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-droppable-widget.html In this video we will discuss jQuery droppable widget Let us understand jQuery droppable widget with an example. 1. From the first box, we want to be able to drag and drop countries on to Countries box, and cities on to Cities box 2. If I try to drop a country on to the City box, or a city on to the Country box, it should not be allowed and the element should revert to it's original position To achieve this we are going to make use of both draggable and droppable widgets <%@ 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 () { $('#source li').draggable({ helper: 'clone', revert: 'invalid' }); $('#divCountries').droppable({ accept: 'li[data-value="country"]', drop: function (event, ui) { $('#countries').append(ui.draggable); } }); $('#divCities').droppable({ accept: 'li[data-value="city"]', drop: function (event, ui) { $('#cities').append(ui.draggable); } }); }); </script> <style> .divClass { border: 3px solid black; font-size: 25px; background-color: lightgray; width: 250px; padding: 5px; display: inline-table; } li { font-size: 20px; } </style> </head> <body style="font-family: Arial"> <form id="form1" runat="server"> <div class="divClass"> Countries & Cities <ul id="source"> <li data-value="country">USA</li> <li data-value="country">India</li> <li data-value="country">UK</li> <li data-value="city">New York</li> <li data-value="city">Chennai</li> <li data-value="city">London</li> </ul> </div> <div class="divClass" id="divCountries"> Countries <ul id="countries"> </ul> </div> <div class="divClass" id="divCities"> Cities <ul id="cities"> </ul> </div> </form> </body> </html>
Views: 16569 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: 76097 kudvenkat
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: 66191 kudvenkat
jQuery class transition animation
 
08: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-class-transition-animation.html In this video we will discuss jQuery UI support for animating class transitions. jQuery UI adds support for animating colors and class transitions. We discussed animating colors in Part 101 of jQuery tutorial. In this video we will discuss animating class transitions. With the basic jQuery functionality, the following methods will not animate style properties of a css class. .addClass() .removeClass() .toggleClass() jQuery UI supports animating class transitions. In the example below a reference to jQuery UI is included, hence the class transition animations work while adding and removing classes. If we remove the jQuery UI reference, class transition animations will not work. <!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> <script type="text/javascript"> $(document).ready(function () { var applyClass = true; $('#btnAnimate').click(function () { if (applyClass) { $('#myDiv').addClass('redDiv', 2000); } else { $('#myDiv').removeClass('redDiv', 2000); } applyClass = !applyClass; }); }); </script> <style> .redDiv { background-color: red; color: white; font-size: 20px; border: 5px solid black; padding: 5px; width: 500px; } </style> </head> <body style="font-family: Arial"> <form id="form1" runat="server"> <div id="myDiv"> At Pragim Technologies, training is delivered by real time software experts having more than 10 years of experience. Interview questions and real time scenarios discussion on topics covered for the day. Realtime projects discussion relating to the possible interview questions. Trainees can attend training and use lab untill you get a job. Resume preperation and mock up interviews. 100% placement assistance. 24 hours lab facility. </div> <br /> <input type="button" id="btnAnimate" value="Animate" /> </form> </body> </html> toggleClass() example : Modify the code in jQuery ready function to use toggleClass() instead of addClass() and removeClass() methods. $(document).ready(function () { $('#btnAnimate').click(function () { $('#myDiv').toggleClass('redDiv', 2000); }); }); The following are the common parameters of a addClass(), removeClass() and toggleClass() methods. className - The css class name that you want to add, remove or toggle speed - animation speed. The value can be a string ('slow', 'normal', or 'fast') or a number of milli-seconds. The default is normal i.e 400 milli-seconds. slow and fast are 600 and 200 milli-seconds respectively. easing - The value is a string the specifies the name of the easing function. Easing functions specify the speed at which an animation progresses at different points within the animation callback - A function to call once the animation is complete List of all easing functions http://api.jqueryui.com/easings
Views: 13289 kudvenkat
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: 82249 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: 84738 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: 54462 kudvenkat
jquery background color animate
 
06: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/07/jquery-background-color-animate.html In this video we will discuss animating colors using jquery. With the basic jQuery functionality, animate() method cannot animate non-numeric style properties like color, background-color, and border-color. jQuery UI adds the ability to animate color properties. In the example below a reference to jQuery UI is included, hence the color animations work. If we remove the reference, color animations will not work, but other numeric style properties (font-size, border-width) continue to work. <!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> <script type="text/javascript"> $(document).ready(function () { var toggleColor = false; $('#btnAnimate').click(function () { var divElement = $('#myDiv'); if (toggleColor) { divElement.animate({ 'font-size': '15', 'border-width': '1', 'background-color': 'red', 'color': 'white', 'border-color': 'green' }, 2000); } else { divElement.animate({ 'font-size': '20', 'border-width': '10', 'background-color': 'green', 'color': 'white', 'border-color': 'red' }, 2000); } toggleColor = !toggleColor; }); }); </script> <style> </style> </head> <body style="font-family: Arial"> <form id="form1" runat="server"> <div id="myDiv" style="width: 500px; border: 1px solid black; padding: 5px; font-size: 15px"> At Pragim Technologies, training is delivered by real time software experts having more than 10 years of experience. Interview questions and real time scenarios discussion on topics covered for the day. Realtime projects discussion relating to the possible interview questions. Trainees can attend training and use lab untill you get a job. Resume preperation and mock up interviews. 100% placement assistance. 24 hours lab facility. </div> <br /> <input type="button" id="btnAnimate" value="Animate" /> </form> </body> </html>
Views: 14706 kudvenkat
How To Code (HTML and CSS)
 
03:58
Try it for yurself: HTML: http:--www.w3schools.com-html-default.asp CSS: http:--www.w3schools.com-css-default.asp CSS: -html- -head- -style type=-text-css-- body { background-color:#d0e4fe; } h1 { color:orange; text-align:center; } p { font-family:-Times New Roman-; font-size:20px; } --style- --head- -body- -h1-CSS example!--h1- -p-This is a paragraph.--p- --body- --html- HTML: -html- -body- -h1-My First Heading--h1- -p-My first paragraph.--p- --body- --html- If You need help coding, message me.
Views: 976 LightsWillEatYoo
How to increase font size in wordpress
 
09:35
How to increase font size in wordpress http://www.yourincomeadvisor.com Link to the codes https://drive.google.com/file/d/0ByO62wiG9iHUdzR5bmNocGh4aWc/view?usp=sharing There are different options to change the font size in wordpress theme and I’m going to show you some of them so you can find one that is more appropriate and easiest for you. 1. Appearance - Editor - custom.css file - Find “Category Navigation and Post Adjustments” - paste the code below 2. Appearance - Editor - Style.css - Find “Entry content” category - change font-size to …whatever you want 3. Appearance - Editor - style.css file - “Basic Styles” - Body - change font-size Basically they are all the same but it needs a bit more exploration and detailed approach or contact the support of your wordpress theme to know exactly which file to modify. 4. Theme settings - main content style settings - Main content font size - change font 5. Just add the code shown in the video and change the text size. 6. WP edit plugin. Install the plugin and activate it and you’re done. 7. Contact your support If you have any questions, don't hesitate to contact me and I will be more than happy to help you out. http://yourincomeadvisor.com/contact-us Subscribe To My Channel for More Great Tips http://www.youtube.com/subscription_center?add_user=YourIncomeAdvisor Ask me a question http://www.yourincomeadvisor.com Follow me https://plus.google.com/101529459439561745154/posts https://www.facebook.com/rufat.yia https://twitter.com/Rufat_YIA http://www.pinterest.com/rufat2071/
Views: 351 Rufat YIA
How to change the font size in WordPress
 
04:59
There are two ways to change the font size in WordPress (3.1) - using the tag drop down box (paragraph, headers 1-6) or by making a universal change to your style sheet. Both are explained here.
Views: 9696 creationdepot
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: 74641 kudvenkat
How to use the font-family CSS property
 
04:32
Here we go! This is the start of becoming master manipulators of every visual component of a web page. But, we have to start with a single CSS property, and what a visually subtle yet powerful one it is.
Views: 892 BuildAModule
ProgressBar(HTML,CSS and Javascript)
 
05:40
CSS: html, body { font-family: 'Teko'; height: 100%; padding: 0; margin: 0; box-sizing: border-box; } body { background: linear-gradient(90deg, #303395 0%, #27F0F0 100%); display: flex; align-items: center; justify-content: center; flex-direction: column; color: #FFF; font-weight: 400; font-size: 2em; text-align: center; text-shadow: 2px 2px 2px rgb(0, 0, 0, 0.6); } #progress { width: 25%; background-color: #9e9e9e; position: relative; border-radius: 15px; overflow: hidden; margin-bottom: 25px; box-shadow: 2px 2px 2px rgb(0, 0, 0, 0.6); } #bar { width: 0%; height: 70px; background-color: #28dae6; } #count { position: absolute; top: 0; bottom: 0; right: 0; left: 0; display: flex; align-items: center; justify-content: center; } button { background: transparent; outline: 0; border: 3px solid #fff; color: #fff; border-radius: 10px; padding: 2px 25px; font-size: .8em; cursor: pointer; text-shadow: 2px 2px 2px rgb(0, 0, 0, 0.6); box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.18); text-transform: uppercase; font-family: 'Teko'; } h1 { margin-bottom: 5px; }
Views: 20 Shawn Tan
CSS property is used to change the text color background color font size of an element
 
08:15
The background-color property sets the background color of an element. how to change the font color using an css and a style that is used in a paragraph tag.
Views: 18 Learn Languages
HTML and CSS Beginner Tutorial - 2 | Background color and image insert and text formating atributes
 
21:55
Background color using Hex color codes. Coloring a webpage background is actually pretty simple. The first and most popular way is by using a Hex color code with the background-color property. Here we apply a Hex color directly on the HTML body tag element using the style attribute. Setting the style of an HTML element, can be done with the style attribute. The color property defines the text color for an HTML element The font-family property defines the font to be used for an HTML element Attributes provide additional information about HTML elements. All HTML elements can have attributes Attributes provide additional information about an element Attributes are always specified in the start tag Attributes usually come in name/value pairs like: name="value" Use the style attribute for styling HTML elements Use background-color for background color Use color for text colors Use font-family for text fonts Use font-size for text sizes Use text-align for text alignment ******************************* Share, Support, Subscribe!!! Subscribe: https://www.youtube.com/channel/UC_QXHjMnd5LvA2caOfxFunA?sub_confirmation=1 Youtube: http://www.youtube.com/c/ChetanBhalothia Twitter: https://twitter.com/Chetanbhalothia Facebook: https://www.facebook.com/technicalchetanbhalothia/ Facebook Myself: https://www.facebook.com/chetan.bhalothia Instagram: https://www.instagram.com/chetan_bhalothia/ Google Plus: https://plus.google.com/+ChetanBhalothia join my WhatsApp group: https://chat.whatsapp.com/8rD8mjcy7RnGl7ZEVxHfkx -~-~~-~~~-~~-~- #TechnicalHelperChetan #ChetanBhalothia
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: 34821 kudvenkat
Basic CSS - Style the HTML Body Element - freeCodeCamp
 
01:43
In today's basic CSS tutorial, we style the HTML body element as part of the Free Code Camp curriculum. Enjoy!
Views: 59 programCity
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: 19853 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: 54237 kudvenkat
Using CSS To Change Font Size
 
04:04
This video demonstrates using CSS to change the text font size..
Views: 888 Leonardus C
CSS Tutorial - Two Column Layout - Floating.
 
19:23
זה החלק השני של הסרטון תהנו ושיהיה לכם בהצלחה Style.css: body { font-family: Arial, sans-serif; background-color: #738294; } #container { width: 900px; padding: 30px; margin: 0 auto; background-color: #FFF; border: 2px solid #80aab7 } #header {} #nav { margin: 0; padding: 0; background-color: yellow; } #nav li { list-style: none; float: left; padding: 0 15px 0 0; } #nav li a:link, #nav li a:visited { text-decoration: none; } #body {} #body p { line-height: 1.6em; } .main { width: 600px; float: left; } .main-inner { padding: 0 60px 0 0; } .side { width: 300px; float: left; } #footer { background-color: #4D5B6C; color: #FFF; } .clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } .clearfix {display: inline-block;} /* Hides from IE-mac \*/ * html .clearfix {height: 1%;} .clearfix {display: block;} /* End hide from IE-mac */ /* @end */
Views: 648 Ameer Sobihh
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: 30246 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: 58604 kudvenkat
jQuery event object
 
11:53
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-event-object.html In this video we will discuss 1. How to retrieve event data using event object 2. How to convert JavaScript event object to jQuery event object Whenever an event (like click, mouseover, mouseout etc) occurs, the relevant data about that event is placed into the event object. For example, the event object contains event data like, the X and Y coordinates of the mouse pointer when the event occurred, the HTML element that fired the event, which mouse button is clicked etc. Obtaining the event object is straightforward. The event object is always passed to the event handler method. Let us understand this with an example. When we click the button, we want to capture the following event data 1. Event name 2. Mouse X coordinate when the event occured 3. Mouse Y coordinate when the event occured 4. The control that raised the event 5. The HTML tag name that raised the event Notice that in the example below, we are passing event object to getEventDetails() method. This object is the raw JavaScript event object. The type property gives us the event name that occured. pageX and pageY properties return the X and Y coordinates of the mouse pointer. Target property returns the HTML element that raised the event. Target, pageX and pageY properties are supported by all modern browsers and Internet Explorer 9 and above. The following code will not work in Internet Explorer 8 and earlier versions. In addition to click event, the following example returns mouseover and mouseout event data. 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 () { $('#btn').click(function () { getEventDetails(event); }).mouseover(function () { getEventDetails(event); }).mouseout(function () { getEventDetails(event); }); function getEventDetails(event) { var eventDetails = "Event = " + event.type + "<br/> X = " + event.pageX + "<br/>Y = " + event.pageY + "<br/>Target Type = " + event.target.type + "<br/>Target Tag Name = " + event.target.tagName; $('#divResult').html(eventDetails); } }); </script> </head> <body style="font-family:Arial"> <input id="btn" type="button" value="Click me" /><br /><br /> <div id="divResult"></div> </body> </html> Cross-browser solution : For the above code to work in all browsers including Internet Explorer 8 and earlier versions, modify getEventDetails() function as shown below. Notice that we are converting JavaScript event object to jQuery event object using $.event.fix() function getEventDetails(event) { var e = $.event.fix(event); var eventDetails = "Event = " + e.type + "<br/> X = " + e.pageX + "<br/>Y = " + e.pageY + "<br/>Target Type = " + e.target.type + "<br/>Target Tag Name = " + e.target.tagName; $('#divResult').html(eventDetails); }
Views: 37002 kudvenkat
jQuery autocomplete with images and text
 
20:12
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-autocomplete-with-images-and-text.html In this video we will discuss how to display both images and text in the suggestions menu of jQuery autocomplete widget. Let us understand this with an example. When we type the first character of a country name, we want to retrieve all the countries that start with that letter and display their flag and name in the suggestions menu. Web Service Code using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Web.Script.Serialization; 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 CountryService : System.Web.Services.WebService { [WebMethod] public void GetCountries(string term) { string cs = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; List<Country> countries = new List<Country>(); using (SqlConnection con = new SqlConnection(cs)) { SqlCommand cmd = new SqlCommand("spGetCountries", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter paramName = new SqlParameter() { ParameterName = "@Name", Value = term }; cmd.Parameters.Add(paramName); con.Open(); SqlDataReader rdr = cmd.ExecuteReader(); while(rdr.Read()) { Country country = new Country(); country.Id = Convert.ToInt32(rdr["Id"]); country.Name = rdr["Name"].ToString(); country.FlagPath = rdr["FlagPath"].ToString(); countries.Add(country); } } JavaScriptSerializer js = new JavaScriptSerializer(); Context.Response.Write(js.Serialize(countries)); } } } jQuery Code <!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({ minLength: 1, source: function (request, response) { $.ajax({ url: 'CountryService.asmx/GetCountries', method: 'post', data: { term: request.term }, dataType: 'json', success: function (data) { response(data); }, error: function (err) { alert(err); } }); }, focus: updateTextBox, select: updateTextBox }) .autocomplete('instance')._renderItem = function (ul, item) { return $('<li>') .append("<img class='imageClass' src=" + item.FlagPath + " alt=" + item.Name + "/>") .append('<a>' + item.Name + '</a>') .appendTo(ul); }; function updateTextBox(event, ui) { $(this).val(ui.item.Name); return false; } }); </script> <style> .imageClass { width: 16px; height: 16px; padding-right: 3px; } </style> </head> <body style="font-family: Arial"> <form id="form1" runat="server"> Country Name : <input id="txtName" type="text" /> </form> </body> </html>
Views: 18156 kudvenkat

Civil service essay writing
Dissertation writing service
How to start a cover letter engineering intern
Cover letter for debt collector resume sample
Picard s method application letters