Posts

Showing posts from September, 2014

CSS Shape-Outside

Image
Today I came across the css 'Shape-Outside' property, which I feel interesting to share. There are times, where we  need to add images and text next to each other. We can do it easily by floating the image then, the text automatically adjust next to image. Problem here here is, image occupies actual width and then text starts after that. What if, we had been told to adjust text around the image, utilizing the empty space. Then the "Shape-outside" property come to the picture. The shape-outside CSS property defines the shape around which content will wrap on the outside of an element. This example simulates a circle exclusion with an exaggerated rounded corners rectangle. The shape is applied to a floated element so that content will wrap around it. The shape-outside CSS property uses shape values to define the float area for a float and will cause inline content to wrap around the shape instead of the float's bounding box. The syntax for this property as

Know IE Browser Version

Here is simple jquery function to know about the IE browser version. jQuery(document).ready(function(){    var browserProperties = $.browser;      if ($.browser.msie) {        if(browserProperties.version < "9"){            alert("Please upgrade your Internet Explorer to verion 9 and above.");                  }    }    });

Jquery Slideup and Slidedown

The jQuery slideDown() method is used to slide down an element. The jQuery slideUp() method is used to slide up an element. These two methods are perfect for showing and hiding content in a non-jarring manner. The slideDown() method shows content by sliding open a given element; the slideUp() method, on the other hand, hides content by sliding closed a given element. These are very basic methods. Following example shows, how can we display a child menu on hover of elements with slideUp() and slideDown() methods. Here is the HTML code. <ul>     <li><a href="index.php" class="current_link">THE LATEST</a></li>     <li><a href="community.php" >COMMUNITY</a>         <ul>             <li><a href="chat.php" >Video Chat</a></li>         </ul>     </li>     <li><a href="business.php" >BUSINESS</a>         <ul>  

Responsive Web Design Tutorial and Explanation

JavaScript Interview Questions for both Experienced and Fresher

1).What is JavaScript? Ans:-JavaScript is a scripting language most often used for client-side web development. 2).Difference between JavaScript and Jscript? Ans:-Both JavaScript and Jscript are almost similar. Java script was developed by Netscape. Microsoft reverse engineered Javascript and called it JScript. 3).How do we add JavaScript onto a web page? Ans:- There are serveral way for adding javascript on a web page but there are two way with is commonly userd by developers If your script code is very short and only for single page then following ways is best a)You can place <script type="text/javascript"> tag inside the <head> element. Code: <head> <title>Page Title</title> <script language="JavaScript" type="text/javascript">    var name = "Vikas Ahlawta"    alert(name); </script> </head> b).If your script code is very large then you can make a javascript file and add it

Check if jQuery plugin is loaded

The previous post checked if jQuery is loaded , now it is time to check if particular jQuery plugin is loaded. Checking if plugin exists or if plugin has been already loaded is useful if you are writing your jQuery code that depends on that plugin. Here is how to check if some jQuery plugin is loaded or not: if(jQuery().pluginMethod) {     //jQuery plugin exists } else {     //jQuery plugin DOES NOT exist } As you know from previous post on namespacing javascript plugins are created as an additional namespace within jQuery namespace. All you have to do to check if plugin exists is to check if it’s namespace / function is defined. For example, let’s assume that my plugin depends on jQuery Validation plugin. To check if validation plugin is loaded I would do the following: if(jQuery().validate) {     // Validation plugin exists     // Now I can use $('#someId').validate() } else {     // Validation plugin DOES NOT exist }

How To Check If JQuery Library Is Loaded?

This article discusses how to check if jquery.js file is loaded. Also, presents a way to force load jQuery file before running any dependant JavaScript code. In order to determine whether jquery.js file is loaded or not, we need to check for existence of jQuery object. Because, when jquery.js file is loaded, it creates a new global jQuery variable. Checking if some class, method, variable or property does already exist is the very basics of any programming language. In our case, the programming environment is JavaScript and the object we are checking for is jQuery() (or $()). This method is not limited to jQuery only, you can check existence of any other variable or function in your javascript. Anyway, as we said earlier, jQuery() or $() functions will only be defined if they are already loaded into the current document. So to test if jQuery is loaded or not we can use 2 methods. Method 1: if (window.jQuery) {     // jQuery is loaded } else {     // jQuery is not loade