logo
Currently Browsing: JavaScript
Feb
20

NicEdit WYSIWYG alignment issue

For those of you that don’t know NicEdit is a pretty awesome little WYSIWYG that is very easy to integrate into any website. Simple slap in a bit of javascript and away you go (well, pretty much). Anyway, I noticed a small problem when trying to align text in firefox, it seemed to break my site completely and gave an error in firebug when clicked. This was a bit of a problem as it was something I needed... 
Aug
25

jQuery IE CSS height issue

Just a quick post as I came across this problem today when I was trying to dynamically set the height of a div depending on the height of another div. My original code was something along the lines of: <script type="text/javascript"> $(document).ready(function(){    var tmpContentSize = jQuery(".colmask").css(‘height’);  ... 
Aug
13

Javascript detect IE

When you have written a few different pieces of JavaScript you come to realize that IE and Firefox have different opinions on what works and what doesn’t work. What this means is you may need to have different JavaScript firing if the current browser is IE! Here is a little example of how we can detect if the current browser is IE: <script type="text/javascript">    //we start... 
Aug
4

jQuery selecting object that has an attribute

jQuery is such a powerful, and fun, language to learn. There may be some situations where the same class is used on multiple objects, and there may be cases where you only want to target one particular type of objects despite the same class being used multiple times. For example: <table class="contentpaneopen"> <tbody> <tr> <td class="contentheading" width="100%"> <h1>MEMBERS</h1> </td> </tr> </tbody> </table> <div... 
Aug
3

jQuery selecting elements with multiple classes

The more complicated the CSS coding the more complicated selecting elements with jQuert can become. You may find yourself with a situation such as: <div class="cOne cTwo cThree"></div> <div class="cOne cTwo"></div> <div class="cOne cThree"></div> So how do we select specific elements when all of these div’s contain the class “cOne”?... 
Jul
25

Selecting Child elements of $(this)

The ‘this’ keyword in jQuery is a very handy tool in your programming toolkit. If you are writing generic functions or you just can’t be bothered writing the id for the DOM element or if you are trying to access any of the child objects of a DOM, the $(this) object is the object for you. I’ll save the finer details of jQuery’s ‘this’ keyword for another day and assume... 

logo
Powered by Wordpress | Designed by Elegant Themes