Posts

Showing posts from September, 2014

How to detect Scroll position of a webpage using jQuery's .scrollTop()

The .scrollTop() function in jQuery allows you to get the current vertical position of the scroll bar for the first element in the set of matched elements or set the vertical position of the scroll bar for every matched element. You can extract the scroll position of a certain page or element using the jQuery's .scrollTop() method . $(window).scroll(function (event) { var scroll = $(window).scrollTop(); // Do something }); You can also determined the percentage and alert the user that he has scrolled certain amount within the document. >$(document).scroll(function(e){ // get the scroll value and the document height var scrollVal = $(window).scrollTop(); var docHeight = $(document).height(); // calculate the percentage when the user scrolls down the page var percentage = (scrollVal / docHeight) * 100; if(percentage > 50) { // call the function called alertUser alertUser(percentage); } function alertUser(scr...

How to Add an Adsense Code Manually into Blogger Template

Image
In this article you'll be able to learn on how to Add an AdSense Code manually into blogger template. If you have an AdSense Account and wanted to setup a blog using blogger. You can however incorporate your approved email account with AdSense in which blogger creates the widget and automatically insert your adcode in between, before or after each posts. You can find anywhere in the web on how to do this thing but here I'm going to give you the instructionswith ease. Let's take a look at the layout below. What we're going to do is put an AdSense code in the green square with "your add here" caption. And we only wanted it to appear on items and or blog posts. 1 On your Blogger's dashboard, Click the Template  then Click "Edit HTML" . 2 Click anywhere on the Template editor window and Press Ctrl+F  then type the following b:widget id='Blog1' in the search box and press Enter. You should see similar to the image below. Within the ...

VB.Net Print PDF Document

Image
Portable Document Format ( PDF ) is a file format used to present documents in a manner independent of application software, hardware, and operating systems. Each PDF file encapsulates a complete description of a fixed-layout flat document, including the text, fonts, graphics, and other information needed to display it. In some applications, web or desktop there are several options where you can convert or Print a PDF version of a form or document you're reading. So, the question is how is it done and is it possible to create your own PDF document from scratch? We'll you're still lucky as I am. In this tutorial you'll be able to learn on how can VB.Net Print PDF Documents . Requirements 1.) CodePlex.com provides a freely downloadable version of the PDFSharp-MigraDocFoundation-Assemblies . 2.) Extract the downloaded .zip file to your project folder. The file name if not updated is PDFsharp-MigraDocFoundation-Assemblies-1_31.zip. Creating the Project 1.) S...

Formatting Date and Time VB.NET

The Date literal must be enclosed within number signs ( #date# ) and specify the date value in the format M/d/yyyy like #09/06/2014# . Else, the way how your code is interpreted may vary depending on the locale in which your application is deployed. With this requirement the meaning of your code should never change whether if it has a different date and time format settings. For example, you hard-coded a Date literal of #9/6/2014# which means September 6, 2014. That will compile 9/6/2014 as you want mm/dd/yyyy. However, if you deploy application in several locales using dd/mm/yyyy date format, your hard-coded literal would compile to June 9, 2014. For other locales using yyyy/mm/dd, the literal would be invalid causing compilation error. To convert a Date literal to the format of your locale or to a custom format, use the Format function of String class, specifying either a predefined or user-defined date format. Predefined Date/Time Formats The following table identifies the ...

Working with Date and Time VB.Net

VB.NET's DateTime structure represents an instant in time which is commonly expressed as a particular date and time of the day. It's a part of your daily life while creating your applications which makes it easy for you to manipulate system's date and time. In this article I'll be showing you the commonly used properties and methods and example usage of the Date and Time in VB.Net. Use the Date data type to contain date values, time values, or date and time values. The default value of Date is 0:00:00 (midnight) on January 1, 0001. You can get the current date and time from the DateAndTime class. DateTime Properties The table below shows some of the commonly used properties of the DateTime Structure: Property Description Date Gets the date component of this instance. Day Gets the day of the month represented by this instance. DayOfWeek Gets the day of the week represented by this instance. DayOfYear Gets the day of the year represented by this instance. H...