Javascript

Javascript browser detection can be useful.  jQuery had the function “.browser” which would detect the users browser, but it was removed in jQuery version 1.9. They now recommend “.support” for browser feature detection.

*using navigator.userAgent can make you vulnerable to spoofing.  Here is a lengthy article.

 

So you’re not supposed to detect users browsers using javascript, but here’s how. Continue reading

jquery

This post is for beginners.  It shows how to make a basic jquery UI accordion. We will use a predefined jquery ui for the accordion. There is a link to the demo right before the entire code snippet. Below is an image of the accordion: Image of jQuery… Continue reading

css

“CSS clearfix” is often needed to clear floats.

  • Examples 1-3 clear floats by applying a CSS class to a p tag. The p tag holds a “non-breaking space” – ascii code for space is “ ”
  • Examples 4 and 5 clear floats by applying the CSS clearfix class in a different manner. The clearfix is applied to a div tag that contains the floated items.

Continue reading

Posted in CSS.