background preloader

Plugin

Facebook Twitter

Flickr

Flutter. Tooltip. jQuery Plugin Checklist: Should You Use That jQuery Plug-In? - Smashing Magazine. Advertisement jQuery plug-ins provide an excellent way to save time and streamline development, allowing programmers to avoid having to build every component from scratch. But plug-ins are also a wild card that introduce an element of uncertainty into any code base. A good plug-in saves countless development hours; a bad plug-in leads to bug fixes that take longer than actually building the component from scratch. Fortunately, one usually has a number of different plug-ins to choose from. But even if you have only one, figure out whether it’s worth using at all. The last thing you want to do is introduce bad code into your code base. Do You Need A Plug-In At All?

The first step is to figure out whether you even need a plug-in. 1. If the functionality is simple enough, you could consider writing it yourself. jQuery plug-ins often come bundled with a wide variety of features, which might be overkill for your situation. 2. Can you find a single plug-in that covers everything you need? 3. 4. 6 Ways to Create a Custom Write Panel in WordPress. When you start to use WordPress as a CMS you begin to realize that one WYSIWYG area isn’t going to cut it. At that point you may start to explore the option of custom fields. They’re great, and they work well for handling small changes.

But what happens when you need to have multiple WYSIWYG areas, or upload files, or manage content using other form fields like checkboxes, radio toggle’s or text inputs. To do this you’ll need the power of custom meta boxes. There are many ways to create them; some involve the use of plugins and some don’t. I’m going to discuss a few of the way’s I’ve created custom write panels, and explain the ups and downs of each approach. If anyone has any suggestions please leave your thoughts as comments; they may be added to the post in the future. WPAlchemy MetaBox PHP Class The best method I have found, and the one I’ve chosen to use personally in my work, is to create meta boxes with PHP. Admin page filtering options Wide range of input field options The Lowdown. Isotope. A Plugin Development Pattern.

I've been developing jQuery plugins for quite a while now, and I've become rather comfortable with a particular style of plugin development for my scripts. This article is meant to share the pattern that I've found especially useful for plugin authoring. It assumes you already have an understanding of plugin development for jQuery; if you're a novice plugin author, please review the jQuery Authoring Guidelines first. There are a few requirements that I feel this pattern handles nicely: Claim only a single name in the jQuery namespace Accept an options argument to control plugin behavior Provide public access to default plugin settings Provide public access to secondary functions (as applicable) Keep private functions private Support the Metadata Plugin I'll cover these requirements one by one, and as we work through them we'll build a simple plugin which highlights text.

Claim only a single name in the jQuery namespace This implies a single-plugin script. JavaScript: Putting it All Together. Developing a jQuery Plugin. Sometimes we get it in our heads that a task is too complex that we just ignore doing it. That's been my mindset when thinking about developing a plugin for jQuery. I've always thought that some of the code I developed would make more sense as a plugin but I just didn't have time to figure it out. After finally pushing myself into learning about jQuery plugins, I was left saying, "That's it?! " It turns out it's ridiculously easy and I have no idea why I haven't been doing this from day one. Why a plugin? First of all, you might ask yourself why you'd want to develop a plugin. $('.className').addClass('enabled').append('<a href="#">Click here</a>').click( func ); This would take every element with a class name of 'className', add a new class name to it, append some HTML, and set a click event handler.

Another reason to develop a jQuery plugin is simply to be consistent with the jQuery ethos. Now, let's take a look at how to create a plugin, of which there are two possible approaches. Jump in. jQuery Tutorials for Designers. 30 Pro jQuery Tips, Tricks and Strategies. Whether you’re a developer or a designer, a strong jQuery skillset is something you can’t afford to be without. Today, I’m going to show you 30 handy jQuery coding tricks that will help you make your scripts more robust, elegant and professional. Getting Started These tips and tricks all have one thing in common- they are all smashingly useful.

With this stuff in your back pocket, you’ll be ready to go change the world, and even better, write jQuery like you know what you’re doing. We’ll start with some basic tricks, and move to some more advanced stuff like actually extending jQuery’s methods and filters. . #1 – Delay with Animate() This is a very quick, easy way to cause delayed actions in jQuery without using setTimeout. For instance, let’s say that you wanted to open a dialog and then fade it away after 5 seconds. Don’t you just love jQuery chaining? UPDATE: jQuery 1.4 has eliminated the need for this hack with a method called delay() . #2 – Loop through Elements Backwards Voila! 20 Helpful jQuery Methods you Should be Using. So you've been playing with jQuery for a while now, you're starting to get the hang of it, and you're really liking it!

Are you ready to take your jQuery knowledge to level two? Today, I'll demonstrate twenty functions and features you probably haven't seen before! 1 after() / before() Sometimes you want to insert something into the DOM, but you don't have any good hooks to do it with; append() or prepend() aren't going to cut it and you don't want to add an extra element or id.

These two functions might be what you need. They allow you to insert elements into the DOM just before or after another element, so the new element is a sibling of the older one. You can also do this if you're working primarily with the element you want to insert; just use the insertAfter() or insertBefore functions. 2 change() The change() method is an event handler, just like click() or hover(). 3 Context Context is both a parameter and a property in jQuery.

So where would this be useful? 4 data() / removeData() 45 Fresh Useful JavaScript and jQuery Techniques and Tools - Smashing Magazine. Advertisement Yes, this is another round-up of fresh and useful Javascript techniques, tools and resources. But don’t close the tab yet, as you might find this one very useful. In this selection we present calendars, forms, buttons, navigation, debugging, optimization and compatibility tables as well as handy resources and tools. We also cover various jQuery-plugins that will help you extend the functionality of your website and improve user experience with ready components or coding solutions. The last section also covers a number of useful educational resources such as a compilation of useful JavaScript coding practices, a detailed comparison of JavaScript frameworks and general JavaScript programming conventions. You may be interested in the following related posts: Calendars and Timelines jDigiClock – Digital Clock (HTC Hero inspired)4 jDigiClock is a jQuery plugin inspired from HTC Hero Clock Widget. jQuery Sliding Clock v1.15 jQuery transpearant Slider clock with CSS sprites.

Flip! Les meilleurs cours et tutoriels JavaScript - Club des décideurs et professionnels en Informatique. jQuery for Designers - Tutorials and screencasts. Fancy lightbox alternative. Including jQuery in WordPress (The Right Way) If you want, you can just download jQuery, put it on your server and link to it from your header.php file in the <head> section. But that can cause you grief. For one thing, some plugins use the jQuery library, and they are going to load it as well.

This can cause problems. How was your plugin to know you already had it loaded? Another thing is that WordPress already includes a copy of jQuery. Your theme probably already has the wp_head function, so just make sure you call the wp_enqueue_script function BEFORE that. <script type="text/javascript" src="<? You are ready to rock, but there are still some considerations. To be super-safe, you can put jQuery into "no conflict" mode and use a different shortcut for jQuery. Can you recognize this bit of code? Easy Ajax with jQuery [JavaScript &amp; Ajax Tutorials] This article was written in 2011 and remains one of our most popular posts. If you’re keen to learn more about jQuery, you may find this recent article on jQuery 1.9 of great interest.

Ajax is changing web applications, giving them a responsiveness that’s unheard of beyond the desktop. But behind all the hype, there’s not much to Ajax — HTML, JavaScript, and XML are nothing new, and in this tutorial, I’ll show you how to simplify the process of adding Ajax to your application even further with the help of jQuery. What’s Ajax? You’ve probably heard about Ajax before, or at least used an Ajax-based application — Gmail, for instance. Quite simply, Ajax is a technique for handling external data through JavaScript asynchronously, without reloading the entire page. SitePoint offers a good introduction to Ajax. Unfortunately, in-depth tutorials on practical ways to enter the world of Ajax are few and far between. What’s jQuery? Assumed Knowledge jQuery 101 $("div.foo").append("Hello World!

"). Easy! jQuery-Map.png (Image PNG, 1024x768 pixels)