Bootstrap Grid for Multiple Devices

Chandu yadav
Updated on 12-Jun-2020 09:02:31

459 Views

The following is an example showing the usage of Grid for multiple devices −Example Live Demo           Bootstrap Example                                          Hello, world!                                      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do                   eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut       ... Read More

Use jQuery noConflict Method

Ricky Barnes
Updated on 12-Jun-2020 09:01:23

225 Views

jQuery.conflict() method allows you to use multiple frameworks, while using jQuery. The $ sign is used for jQuery, but what if other frameworks also use the same $ sign; this may create issues and conflict. To avoid this, jQuery issued the noConflict() method. The method releases the $ sign to be used my other JavaScript frameworks. Use jQuery with the name, jQuery.ExampleYou can try to run the following code to learn how to work with the noConflict() method −Live Demo $.noConflict(); jQuery(document).ready(function(){    jQuery("button").click(function(){       jQuery("h3").text("jQuery works perfectly");    }); }); ... Read More

Write a Custom jQuery Plugin

Ricky Barnes
Updated on 12-Jun-2020 09:00:13

288 Views

To create a jQuery plugin, first create a file named jquery-demoplugin.js with the following code. This is our plugin code. Here, demoplugin is the name of our plugin. You can add any name to your custom plugin −(function ( $ ) {    $.fn.demoplugin = function( options ) {       var web = $.extend({          name: 'example'       }, options );       return this.append('Website: ' + web.name + '.com');    }; }( jQuery ));Now, to load it, add to the HTML file, new.html −    $( document ).ready(function() {       $( '#content ).demoplugin();    });

Offset Columns in Bootstrap

George John
Updated on 12-Jun-2020 08:59:08

6K+ Views

An offset is used to push columns over for more spacing. To use offsets on large displays, use the .col-md-offset-* classes. You can try to run the following code to learn how to work with offset columns in Bootstrap −Example Live Demo           Bootstrap Example                                          Heading One                                      This is demo text. This is demo text.                                

Purpose of Wrapping JavaScript Files in Anonymous Functions

Anvi Jain
Updated on 12-Jun-2020 08:58:55

978 Views

The purpose of wrapping is to a namespace and control the visibility of member functions. It wraps the code inside a function scope and decreases clashing with other libraries. This is what we call Immediately Invoked Function Expression (IIFE) or Self Executing Anonymous Function.SyntaxHere’s the syntax −(function() {    // code })();As you can see above, the following pair of parentheses converts the code inside the parentheses into an expression −function(){...}In addition, the next pair, i.e. the second pair of parentheses continues the operation. It calls the function, which resulted from the expression above.

Use Multiple Versions of jQuery on the Same Page

Amit D
Updated on 12-Jun-2020 08:58:44

4K+ Views

Yes, you can use multiple versions of jQuery on the same page. To avoid any kind of conflict, use the jQuery.noConflict() method. jQuery.noConflict() method allows you to use multiple frameworks, while using jQuery. Other JavaScript frameworks include Ember, Angular, Backbone, etc.The $ sign is used for jQuery, but what if other frameworks also use the same $ sign; this may create issues and conflict. To avoid this, jQuery issued the noConflict() method. The method releases the $ sign to be used my other JavaScript frameworks. Use jQuery with the name, jQuery.With this, you can also use multiple versions of jQuery ... Read More

HTML Canvas shadowBlur Property

Arjun Thakur
Updated on 12-Jun-2020 08:56:26

206 Views

The shadowBlur property of the HTML canvas is used to set the blur level for shadows. The default value is 0. The element allows you to draw graphics on a web page using JavaScript. Every canvas has two elements that describes the height and width of the canvas i.e. height and width respectively.Following is the syntax −ctx.shadowBlur=num;Above, the num represents the blur level for the shadow.Let us now see an example to implement the shadowBlur property of canvas −Example Live Demo    var c = document.getElementById("newCanvas");    var ctx = c.getContext("2d");    ctx.shadowBlur = 20; ... Read More

Use Multiple JavaScript Libraries with jQuery

Amit D
Updated on 12-Jun-2020 08:56:18

431 Views

jQuery.noConflict() method allows you to use multiple frameworks, while using jQuery. Other JavaScript frameworks include Ember, Angular, Backbone, etc.The $ sign is used for jQuery, but what if other frameworks also use the same $ sign; this may create issues and conflict. To avoid this, jQuery issued the noConflict() method. The method releases the $ sign to be used my other JavaScript frameworks. Use jQuery with the name, jQuery.You can try to run the following code to learn how to use multiple JavaScript libraries along with jQuery −    var $x = jQuery.noConflict();    // ... Read More

Bootstrap Grid System Usage

Chandu yadav
Updated on 12-Jun-2020 08:55:16

139 Views

Bootstrap Grid System provides the following strategy for structuring content on a web page −ContentDetermine what is most important. LayoutDesign to smaller widths first.Base CSS address mobile device first; media queries address for tablet, desktops.Progressive EnhancementAdd elements as screen size increases.

Create a Custom jQuery Plugin

Amit D
Updated on 12-Jun-2020 08:54:35

608 Views

To create a jQuery plugin, firstly create a file named jquery-myplugin.js with the following code. This is our plugin code. Here, myplugin is the name of our plugin.(function ( $ ) {    $.fn.myplugin = function( options ) {       var web = $.extend({          name: 'tutorialspoint'       }, options );       return this.append('Website: ' + web.name + '.com');    }; }( jQuery ));Now, to load it, add to the HTML file, new.html: $(document).ready(function() {    $('#myclass').myplugin(); }); Run the above code and you can see the text is visible, which shows your custom plugin is working correctly.

Advertisements