Crucial Tips For Creating A Responsive Website

As I mentioned earlier, it’s the age of mobile devices nowadays. In fact, there are 6.8 billion people on the planet, 4 billion of them use a mobile phone and only 3.5 billion of them use a toothbrush.

How ridiculous it is! That’s why if your website doesn’t read well on those devices, it is possible to lose out on a huge chunk of potential customers. This is where responsive design can come into the picture and save your day nicely.

Good news is that creating a responsive website from scratch isn’t as daunting as it once was. Follow these crucial tips for a responsive site that actually works well and provides the flexibility it’s supposed to.

Keep things simple

One of the first and foremost principles to keep in mind when creating a responsive website: simplicity is the key to brilliance. Sometimes, web designers want to show off their excellence designing skills when creating a website. That’s not bad at all but when it comes to a responsive website, everything should be made as simple as possible. Also, 2016 is about minimalism and simplicity.

Remember that you are delivering the content to very limited space, there’s no room out there for you to clutter up.

Remove the unnecessary content

In order to make your responsive site really shine, simply bear one thing in mind: get rid of non-essential content. It’s not only for your user experience but also the website’s speed.

You know some content or elements of a desktop website are never meant to be used in its mobile version. Our goal is not to precisely reproduce the desktop website, but to offer the same experience to all visitors even coming in through their smartphone or their tablet.

Take the sidebar as an example, it’s a fundamental element of desktop web design, but it can clutter up the limited space of mobile screens.

Always prioritize mobile devices

Because mobile is becoming more relevant than desktop, you should always focus on the way visitors interact with your website by using their mobile phones first. Then build out your design for larger screen size. This will ensure the best possible user experience across all platforms.

Make your images flexible

Everyone already knew that one of the drawbacks of responsive design is a slow loading time. But not all of them know the main reason behind a slow site is non-optimized images. So don’t let those images drag your responsiveness down.

You can make your images flexible in a variety of ways, but one of the easiest methods is using this little handy tool: Adaptive Image

One more thing, be sure to use GIF, JPEG or PNG-8 formats to limit file sizes and help speed up the website.

Make friend with Media Queries

For those who haven’t been acquainted with media queries yet, they are a feature of CSS3 that allow content to respond to different condition on a particular device. Media queries check for a device’s resolution, height, width, and orientation. Media queries come in really handy when creating a responsive website. They are extremely simple to use as well.

Make your website readable

Nothing is more frustrating than zoom in and out, up and down, right and left to read the content. So, make sure your website legible. Visitors always want convenience, not a challenge. Your text should be large enough and comfortable to read from a smaller screen. I highly recommend a text size of 16px, 1 em or 12 pt.

Final thought

These mentioned above are just some of the more important ones you can try out. And hopefully, by now you already had some ideas of how you can use these tips for your stunning responsive website.

How to Create a Basic Plugin by jQuery

jQuery is a quite small yet fast JavaScript library that consists of a number of extensible and durable features, and commonly used as a single method that performs a series of operations on one selection. For example, its easy-to-use API is consistent with all browsers and can easily enable HTML animation, DOM manipulation, and event handling. Thus, bringing a more effortless client-side scripting for software programmers. In this article, let’s see how to write a plugin with jQuery.

How jQuery works: jQuery Object Methods

Before starting to write your own plugins, you must pretty understand how jQuery works first. Take a look at this code:

jQuery, programming language, javascript, software development, code, plugin

This is a basic jQuery code, but do you know what’s happening behind the scenes? When you use the $ function to select elements, it gives back a jQuery object which contains all of the methods you’ve been using (.css(), .click(), etc.) and every element that fits your selector. These methods come from the $.fn object.

Chaining

To help your plugin survive in the real world, there are a couple of things you need to do for it. When you link 4 or 5 actions onto one selector, you’re coming to the chaining feature of jQuery. This feature is done by having all jQuery object methods return the original jQuery object again (exceptions: .width() only returns the width of the selected element, not chainable). Making your plugin method chainable just takes one line of code:

jQuery, programming language, javascript, software development, code, plugin

Protecting the $ Alias and Adding Scope

Since the $ variable is very popular among JavaScript libraries, a conflict in the use of $ may arise when more than one jQuery library is required. The solution to this problem is you must place the code inside the expression of the immediately invoked function. This is carried out by the passing of jQuery and then naming its parameter $.

Adding Private Methods and Variables

After the alias ($) matter is resolved, move on to the next step: adding private methods or variables. In JavaScript (this case is jQuery), functions contain several variables and other functions that can be mainly accessed from inside the function, thus making the elements private. For the best way to access private variables and methods, you must use Immediately invoked function expressions.

Remember adding a private variable and enabling its use is only possible by using the Immediately Invoked Function:

These private methods can solely be called from within the scope of the function and only other private methods or public methods have the authority to call them. This is also for accessing the private variables.

Adding Public Methods

Public methods can be accomplished by nearly the same process as what you just did with private methods. There’s just one difference between these 2, the execution of the method. The method becomes public when it is supplied with a ‘this’ operator. The purpose of adding such public methods could be either to perform a function or to access the public variables and methods from outside the scope of the function.

Accepting Options for Plugin Customization

In some cases, your plugins turn more complex as you continue to add to them. Hence, it is a smart idea to make your plugin be capable of accepting some options and make them customizable. The easiest way to do this, especially when there are a lot of options, is with an object literal.

Putting it All Together

Combining all techniques we’ve discussed, the result is the following small plugin as below:

As you can see, the syntax ‘each()’ is used to loop through a collection of elements. Also, the return value for this method is the ‘this.append()’ which accepts the callback. We will be able to see what element is being appended to in the collection whereupon it returns.

Hope our simple guidance for coding with JavaScript and this one – jQuery could help you be quite well-prepared and get ready to start the work by yourself. Now, let’s go code your own plugin, and don’t hesitate to share any of your confusion with Designveloper right down here in the comment box.