Webkit hates me!

So if you are viewing this site in safari chances are you have noticed that occasionaly the site doesn't load and instead just shows a completely blank page. I noticed this too and after much searching for answers It turns that the fault is not mine (I hope but do please comment if you think it is). There seems to be a bug in Webkit, the only thing I can think to do is to post a warning to safari users, the disconcerting thing  is that this bug was reported quite a while ago and still seems to be occuring.

I contacted  Sarah Ricks who filed the bug report and she said that she hasnt noticed it happning on her site recently but is not sure what could have caused the change.  Needless to say this is pretty anoying.

JQuery Loves me!

I having been using JQuery for a while now but only recently have I started trying to use it elegantly.

 

var tabbedcontents = "#tabbed-holder";
var tabbedmenu = "#tabs";

$($(tabbedcontents)).children("div:not(:first)").css("display", "none");
//hide all but the first div if content
var currentOn = $($(tabbedcontents + " div:first"))
// set current var
 $('[rel=tab]').click(function(e) {
    e.preventDefault();
    // to stop the div jump
    $(tabbedmenu + ' li a.active').removeClass('active');
    $(this).addClass('active');
    currentOn.css("display", "none");
    $($(this).attr("href")).css("display", "block");
    currentOn = $($(this).attr("href"));
});

 

The function above takes in the division holding the tabbed navigation and the division holding the tabbed contents. Firstly it hides all but the first division of contents. It then sets up the first tab as active and then click handler for the tabbed menu. The click handler starts by disabling the defualt action of the anchor and then handles the active class, hides the currently visible content division and then uses the href value of the click tab to show the desired content. It would be pretty simple to add your own animation effect and with javascript disabled the html will degrade to use the anchors to jump to content. Easy!

show me comments