Javascript archive

slavko's picture

Writing a simple Sublime Text plugin.

For the most part I like to keep my code editors as light and vanilla as possible. Some of the basic features that I like to see in my editor include auto indentation, syntax highlighting and ability to search across the project. Anything that will help debugging my codebase is a plus. Sublime Text offers all of these features out of the box and much more with the addition of community contributed plugins. One of the neat Sublime Text features is that it provides you with a list of commands which you can extend (or write your own) and assign them to different key binds. Read More…

dan's picture

Metal Toad University - Class #4: JavaScript!

Want to catch up with Metal Toad University? Go through the previous classes here! The fourth class we held was an intro to JavaScript (JS), guest hosted by Robbie Ferrero. Robbie gave us a great presentation on what JS is and how to use it. We covered the basics like what a variable is and what a function is. At the end, I demoed a small piece of code that I wrote during that class. It allowed me to demonstrate some JS in action. Read More…

1 comment. Filed under mtu, Javascript.

slavko's picture

How To Detect Which Element Was Clicked, Using jQuery

Sometimes we would like to find out which particular element (or set of elements) has user clicked on. However, binding click events on each element manually might not be the most practical way of accomplishing this. Or we might want to fire a certain event if user clicks on anything but particular element(s). I will describe one of such scenarios below and offer one of possible solutions to it using jQuery. Example In our example we have a menu toggle button which shows/hides menu item list. We want the item list to stay open until user clicks on the menu toggle button or somewhere outside the item list. Read More…

dan's picture

JavaScript: Resizing text to fit in a container

This span is too big for this div This is a simple problem and a simple solution. Often in the world of dynamic data we find ourselves with data that is larger than the container. There are ways of handling this like a scrolling div or adding ellipses to chopped of text, but what if you absolutely must see all of the text and are willing to change to font size to accomplish this? Using this little recursive jQuery snippet you can accomplish this. Read More…

Pages