Twitter Bootstrap is powerful mobile first front-end framework that provides all the necessary components to develop responsive websites using its common elements. One of the most popular elements on any website is the top navigation bar and the search widget. On a recent project, I had to implement Bigger & Fixed Search Box with Dropdown in Bootstrap Navbar and making the search bar fixed across different screen size.

Read More

The power of jQuery offers many features to web developers. jQuery has addClass(), removeClass() and toggleClass() methods to change class.

//Add a class
$('#element').addClass('class_name');

//Remove a class
$('#element').removeClass('class_name');

//Remove old class and add new class
$('#element').removeClass('old_class').addClass('new_class');

//Or a short way to swap classes
$("#element").toggleClass('old_class new_class');

Read More

Sometimes we faced the problem of toggling the class in html because of only by changing the classes can do a different action in html.

Toggle class means exchange the class names. We can toggle class using jQuery as follows:

$(document).ready(function(){

if($('#id').hasClass('active'))
$('#id').removeClass('active').addClass('deactive');
else
$('#id').removeClass('deactive').addClass('active');

})

Read More