scriptygoddess

Archive for the ‘Javascript’ Category

Ran into a bizarre problem today using swfobject. A lot of wasted time, but I'll give you the short story / solution. I'm not sure of what other factors played a role (the fact that the element was in a absolute positioned container, or that the immediate container to the flash element was in a [...]

08 Aug, 2009

Adding alternate row styles to a table with JQuery

Posted by: Jennifer In: jquery

JQuery's simplicity is so wonderful and powerful. Here's a perfect example. If you have a table, and you want to alternate the row colors. To do so, all you need is this: $(document).ready(function() { $("table.striped tr:nth-child(even)").addClass("altrow"); }); Then, just add class="striped" to your table tag, and jquery will automatically apply add the class "altrow" to [...]

A recent project I've been working on involved a portfolio page that required a "carousel" type browser. It also needed to have multiple rows (so that images could be grouped into various projects). Also, because this page would contain a large number of images, it was required that the images not be loaded until you [...]

01 Feb, 2009

jQuery Side Scroll

Posted by: Jennifer In: jquery

(This post has been almost completely re-written. Usually I don't that – but I thought it would be more confusing to have all the changes, strikeouts, etc.) For a project I'm going to be working on, I needed to create a navigation piece that had different panes scrolling/sliding in from the right depending on what [...]

20 Sep, 2008

Overlapping Tabbed Navigation using CSS and jQuery

Posted by: Jennifer In: CSS|jquery

Recently had a project land on my desk that required tabbed navigation that overlap one another. Just so we're clear on what we're doing: here's the demo. Here is how I did it: 1) Each tab has four "states" – Off, Off (with right tab on), On, On (with right tab on). I combined each [...]

Here's a method you can use with the validation jQuery plugin to make sure a field (like a password field) includes at least one number. $.validator.addMethod("atleastonedigit", function(pass) { if (pass == "") { return true; } return ((/[0-9]+/).test(pass)); }, "This field must contain at least one number");

13 May, 2008

Proportional Scaling Calculator

Posted by: Jennifer In: Javascript|Scripts

I'm sure this has been done before since it's pretty simple – I just couldn't find it quick enough when I needed it. And since it is so simple, it was easier to just create my own personal little calculator than dig around, find one, bookmark. (or worse yet, do the math on a little [...]

03 May, 2008

Phone number validation with jquery

Posted by: Jennifer In: Javascript|jquery

One of the things I've been playing around with a lot recently is jquery. Why I didn't jump on this bandwagon sooner, I'm not sure, but I am kicking myself for it. So I am still a bit of nub on the jquery front – but I like to think I pick things up quickly. [...]

Awhile back, I had a project where I created a nice clean (X)HTML page including navigation using UL and LI tags. A few months later the client decided they wanted to add a dropdown menu to the navigation. No problem, I thought. We just add the embedded lists to the navigation – style it with [...]

This is probably considered "Javascript 101" – but I still had a bit of trouble finding just the right syntax to work. Simply needed a button to open a new page (in the same browser window): <input type="button" value="THERE REALLY ARE OTHER SEARCH ENGINES!" onclick="location.href='http://www.yahoo.com'; return false" />


Featured Sponsors

About


Advertisements