Profile

All time reputation: 945

Achievement

first submission:submitting first snipplet popular snippet:having a snipplet with 20 favorites

1man's Recent Snippets



« Prev 1 2 3 4
  1. FAV

    Check to see if function triggered by an event

    Rather that using $(element).trigger('click'), check to see if execute has come from an element rather than directly.
    jQuery 1 views posted 8 years ago 1man
  2. FAV

    Store the relationship between elements using .data()

    Very useful snippet to link elements together.
    jQuery 2 views posted 8 years ago 1man
  3. FAV

    Switch using an Object

    Using an object as a simple switch.
    JavaScript 1 views posted 8 years ago 1man
  4. FAV

    Vertically centre a menu without setting an explicit width

    Useful bit of CSS to vertically centre a navigation. Good for Pagination.
    CSS saved by 1 person 2 views posted 9 years ago 1man
  5. FAV

    Validate an age using jQuery Validator plug-in

    Useful snippet i found on a forum, use it to check to see if a user is old enough to submit a form.
    jQuery saved by 2 people 8 views posted 9 years ago 1man
  6. FAV

    Module layout in JavaScript

    Simple illustration of structuring your JavaScript and minimising your use of global vars.
    JavaScript 1 views posted 9 years ago 1man
  7. FAV

    Exceptions in JavaScript

    An example taken from JavaScript: The good parts showing how to catch an exception.
    JavaScript 2 views posted 9 years ago 1man
  8. FAV

    Cache files with jQuery and ajax method

    Handy little snippet i found in 'jquery enlightenment' for caching certain selected files. Could be useful for larger files later on in a site.
    jQuery saved by 9 people 1 views posted 10 years ago 1man
  9. FAV

    Simple jQuery plugin layout + how 'this' works

    Simple plugin to demonstrate how the 'this' keyword is used. Plugin also allows chaining via the 'return'
    jQuery 4 views posted 10 years ago 1man
  10. FAV

    Simple jQuery page scroller

    Example in 'jQuery enlightenment' Simple way to jump smoothly down the page without the use of a plugin.
    jQuery saved by 12 people 2 views posted 10 years ago 1man
  11. FAV

    Custom jQuery selector

    Example given in the book jQuery Enlightenment. Create your own custom selectors in jQuery and manipulate as usual.
    jQuery 2 views posted 10 years ago 1man
  12. FAV

    jQuery and Yahoo pipes simple ajax call

    Very simple example of pulling in a JSON feed from Yahoo pipes using jQuery.
    jQuery 2 views posted 10 years ago 1man
  13. FAV

    Function Timing Example (includes jQuery)

    A way to time how long it takes to get through a certain block of code. Good way to measure performance on the page. You could also use the built in logging functions in firebug. Not sure how they would tally up in a test.
    jQuery saved by 1 person 2 views posted 10 years ago 1man
  14. FAV

    Add class of 'last' to every 3rd image

    Quick little clientside script to pick out every 3rd image and add a class of last to it. I needed this because the images were layed out in 3 columns, adding a margin to the right hand side would leave a large gap on the right hand side which i d...
    jQuery 0 views posted 10 years ago 1man
  15. FAV

    Add hasJS class to HTML element

    Adds a class of hasJS to the html element, can be used for CSS styling.
    JavaScript saved by 9 people 2 views posted 10 years ago 1man
  16. FAV

    Button Sliding Doors

    Finally got round going through a sliding door example myself. All fairly straightforward apart from a few IE6 issues (who would have guessed!). The button is floated so you may need to add overflow: hidden to it's container.
    CSS saved by 4 people 0 views posted 10 years ago 1man
  17. FAV

    Css Button Sliding doors

    Useful little spippet for a button anchor where the text may change.
    CSS 0 views posted 10 years ago 1man
  18. FAV

    Add table row to the bottom of a table

    Great little snippit to add a <tr> to the bottom of a table. Note the use of the context in the jQuery e.g var n = $('tr:last td', this).length; Will have to use this in the future, very good to know!
    jQuery saved by 36 people 6 views posted 10 years ago 1man
  19. FAV

    Example of YAML Markup

    Simple markup example in YAML.
    Other 1 views posted 10 years ago 1man
  20. FAV

    Simple jQuery Equal Columns Plug-in

    A very simple plug-in I wrote to make x number of columns equal height. Looks for the column with the biggest height then sets the rest to the same. I'm sure it can be made cleaner, will look into that later.
    jQuery saved by 36 people 8 views posted 10 years ago 1man
  21. FAV

    jQuery event namespace

    Adding a namespace to an event can make it easier to unbind. It is very easy to unbind all events with the same namespace.
    jQuery saved by 4 people 1 views posted 10 years ago 1man
  22. FAV

    Find selected elements index

    Never used the index() method in jQuery but could be useful to know. Find a selected elements index when you click on it. Note the $('ul#mylist') inside the index method, gives the search some context of where to look for .selected, saves looking thr...
    jQuery saved by 1 person 1 views posted 10 years ago 1man
  23. FAV

    Simple jQuery Imagefader

    Simple imagefader to rotate around a few images. Seem to be doing this a lot in various projects so decided to put something a bit more generic together. Uses jQuery. Images named as car1.jpg, car2.jpg, car3..... etc.
    jQuery saved by 27 people 3 views posted 10 years ago 1man
  24. FAV

    Auto Update Copyright Year

    Very simple snippet to include if you want to auto update the year in a page copyright using PHP.
    PHP saved by 24 people 5 views posted 10 years ago 1man
  25. FAV

    Format for CleanCSS

    This is the custom layout template i use for the CleanCSS website, very handy!
    Other 0 views posted 11 years ago 1man
  26. FAV

    Remove text from a node (e.g in links)

    Removed a certain word from a list of links (purely for design reasons). Link length way to long with the link included.
    jQuery saved by 9 people 1 views posted 11 years ago 1man
  27. FAV

    jQuery Input value select

    Click on an input field with a prefilled value, if that value equals the default then select it, if not leave it as it was. Relies on jQuery.
    JavaScript saved by 18 people 2 views posted 11 years ago 1man
  28. FAV

    Use of PHP isset for a submit form

    Simple PHP tutorial on how to use isset.
    PHP 8 views posted 11 years ago 1man
  29. FAV

    JSON-P with jQuery

    Using JSON-P with jQuery. Note the callback.
    JavaScript 1 views posted 11 years ago 1man
  30. FAV

    CSS Transparency All Browsers

    Should also work in IE6 because of the filter
    CSS saved by 20 people 4 views posted 11 years ago 1man
« Prev 1 2 3 4