There is an HTML5 (originally IE extension) property frameElement on window:
alert(frameElement.id);
But this is not globally supported; you won’t get it in Google Chrome (at the time of writing; version 7) or in older versions of the other popular non-IE browsers.
Read more…
I had a requirement for a series of select boxes that required the related one to only allow selections above the first. I created a little utility function that enables and disables the options based on a function you supply. Usage is pretty simple. Pass in the first and second select as jQuery objects, then pass in your function that evaluates whether an option is enabled or not.
Read more…
When processing sortables etc. Its handy to be able to get the index of individual items. Heres how you find the position of an li within a list:
var position = $item.parent().find('> li').index($item) + 1;
Its been a while but I’m not far off releasing my cms and am just reworking the interface. Previously it had fixed panels at the top and left of the page but on some sites this caused the page to be squashed so I looked into creating docking panels and here is the result. It takes an unordered list with two marker classes and turns it into tabs and fly-out, dockable panels.
Read more…
Sometimes equal height columns via css can be an absolute nightmare! If you’re using jQuery for other items on the page you can cheat with the following function :
function setEqualHeight(items) {
var highest = 0;
items.each( function(){
current = $(this).height();
if(current > highest){
highest = current;
}
});
items.height(highest);
};
Read more…
Coming from a .net background I must admit to missing many of the features that the framework provides like Hastables,
Dictionaries and Lists. I've just come up with a really simple dictionary class that I use to hold results from my id parsing routine.
Read more...