A mixed-case title presents problems with vertical alignment: if none of the letters have a "descender" -ie the title does not include any of g j p q y - then you may want to sit the title lower on the page than if it does.
Here is a simple php function to check whether a string includes a descender:
function hasDescender($thisString){
return (preg_match("/[gjpqy]/", $thisString));
}
Friday, 27 November 2009
Thursday, 12 November 2009
Anchor link fires despite "return false"
I wasted a long time wondering why I couldn't stop the link for an anchor tag firing after the onlick Javacsript had run. Was it because I was setting the onclick function using window.onload?
No - it was because I had errors in the function that I was calling. And because of that, it wasn't getting the the return false at the end (which is what stops the src link being followed by browsers with Javascript working).
No - it was because I had errors in the function that I was calling. And because of that, it wasn't getting the the return false at the end (which is what stops the src link being followed by browsers with Javascript working).
Saturday, 7 November 2009
Scriptaculous Sortables - this.observer is not a function
Hit errors with the error message "this.observer is not a function" when releasing a dragged object using the excellent Sortables function from scriptaculous.
Much grief before I eventually found the problem: where all the other options settings require the value to be in quotes, the "onUpdate" parameter requires the function name NOT to be quoted
.
So - use onUpdate:showList not onUpdate:'showList'
Much grief before I eventually found the problem: where all the other options settings require the value to be in quotes, the "onUpdate" parameter requires the function name NOT to be quoted
.
So - use onUpdate:showList not onUpdate:'showList'
Subscribe to:
Posts (Atom)