888888.888888.88""Yb..dP"Yb..8888b..Yb..dP.88b.88....db....8b....d8.88..dP""b8..dP"Y8
88__...88__...88__dP.dP...Yb..8I..Yb.YbdP..88Yb88...dPYb...88b..d88.88.dP...`".`Ybo."
88""...88""...88"Yb..Yb...dP..8I..dY..8P...88.Y88..dP__Yb..88YbdP88.88.Yb......o.`Y8b
88.....888888.88..Yb..YbodP..8888Y"..dP....88..Y8.dP""""Yb.88.YY.88.88..YboodP.8bodP'


88b.88.888888.888888.Yb........dP.dP"Yb..88""Yb.88..dP
88Yb88.88__.....88....Yb..db..dP.dP...Yb.88__dP.88odP.
88.Y88.88"".....88.....YbdPYbdP..Yb...dP.88"Yb..88"Yb.
88..Y8.888888...88......YP..YP....YbodP..88..Yb.88..Yb

February 23, 2010

Centered jQuery Tabs Shake UI Bug

I created a jQuery site a few years ago for a local psychologist. It’s a tabbed jQuery design I put together to replace an old Wordpress install. While the updated jQuery design looks more modern than the Wordpress-as-a-CMS design it replaced, that was not the primary reason for the overhaul.

What prompted me to switch to jQuery? I was moving from Site5 to Media Temple, and as you may know, importing/exporting Wordpress databases is not fun. Not difficult, but time-consuming and a tad dangerous. I thought it would be easier to simply redesign the site from scratch in jQuery. And I was right. The new jQuery site is essentially one file that contains the content of all six tabs. One file is easy to manage and easy to move to a new host. Much easier than a Wordpress install that needs regular security updates, a new database password, etc. OK, one file not including the jQuery library files, but you get the idea. I used jQuery’s ThemeRoller to pick the colors I wanted. No laborious tweaking of RGB hex values.

What’s Shaking?

The move to Media Temple went fine. Years passed. Then yesterday a friend told me his uncle might need a website. I decided to check on that old jQuery site. Started playing with the tabs. What’s this? The third tab shifts the entire page a pixel or two to the right or left, coming and going. The 4th tab doesn’t, the 5th does, something like that. Hover the mouse over each tab in sequence and you get the undesired “shake” effect. It’s even more noticeable because I’m using a jQuery mouseover event to activate the tabs without requiring a click.

Why does it shake now, when it didn’t shake before? Browsers change. New Firefox. New Google Chrome. But the page uses jquery-1.3.1, that hasn’t changed. Maybe a new version solves this problem?

Upgrading to jQuery 1.4 was easy. I simply changed this (index.html) line:

<script type=”text/javascript” src=”http://pjbrunet.com/jquery-1.3.1.min.js”></script>

to this:

<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js”></script>

Same problem. (In case you’re wondering, I reverted back to 1.3.1.) Turns out this is a UI bug, but “no date set” for a fix.

Position:fixed Workaround

It appears the source of the problem is the “auto” margin. This was the problem for me:

<body style=”background-image:url(body_bg.gif);width:713px;margin:0 auto;padding:20px;”>

Maybe I could drop in the ancient “center” tag and that would solve everything. Well, I’m not sure if this solution is any more valid with its negative margin, but it works:

<body style=”background-image:url(body_bg.gif);width:713px;position:fixed;margin-left:-356px;left:50%;padding:20px;”>

Notice the negative margin is (approximately) half of the width of the body.

Peace Symbols And Hearts
Display symbols?
10715 comments
page 77
Peace Symbols And Hearts
Symbol codes myspace display name?
10715 comments
page 77
Peace Symbols And Hearts
Facebook name symbols?
10715 comments
page 77
Peace Symbols And Hearts
Myspace text symbols?
10715 comments
page 77
Peace Symbols And Hearts
Facebook character symbols?
10715 comments
page 77
Peace Symbols And Hearts
Facebook name symbols?
10715 comments
page 77
Peace Symbols And Hearts
Facebook name symbols?
10715 comments
page 77
How To View Hidden Friends List
How to see private friends list facebook?
182 comments
page 85
How To View Hidden Friends List
Viewing hidden friends on facebook?
182 comments
page 85
Peace Symbols And Hearts
Cool signs for facebook names?
10715 comments
page 77
Peace Symbols And Hearts
Symbol pictures for facebook?
10715 comments
page 77
Peace Symbols And Hearts
Facebook text symbols?
10715 comments
page 77
Peace Symbols And Hearts
Myspace text symbols?
10715 comments
page 77
Covert Facebook Tracking
Can i tell who is looking at my facebook?
640 comments
page 48
Peace Symbols And Hearts
Text symbol codes?
10715 comments
page 77
Peace Symbols And Hearts
Hidden symbol for facebook status message?
10715 comments
page 77
Answers To Your Questions
Facebook see who looks at your profile?
1643 comments
page 43
Answers To Your Questions
Fero dynamics view hidden friends list?
1643 comments
page 43
Covert Facebook Tracking
Whos seen my facebook?
640 comments
page 48
Answers To Your Questions
Facebook see whos looking at your profile?
1643 comments
page 43
Answers To Your Questions
Facebook who looks at my profile?
1643 comments
page 43
Peace Symbols And Hearts
Myspace writing symbols?
10715 comments
page 77
Kool Writing Contest
Myspace writing symbols?
194 comments
page 54
Peace Symbols And Hearts
Myspace letter symbols?
10715 comments
page 77
Peace Symbols And Hearts
Letter symbols for myspace?
10715 comments
page 77
Peace Symbols And Hearts
Make text look cool on myspace?
10715 comments
page 77
Answers To Your Questions
Facebook who is looking at your profile?
1643 comments
page 43
Answers To Your Questions
How would you know if someone hacked into your bebo or facebook?
1643 comments
page 43
Peace Symbols And Hearts
Myspace symbols?
10715 comments
page 77
Covert Facebook Tracking
How to see if someones viewed your profile?
640 comments
page 48
Display Name Size Color
Picture name text?
1001 comments
page 93
Answers To Your Questions
How to see if someones viewed your profile?
1643 comments
page 43
  1 query every 33 seconds, updated 1 seconds ago.
Post a comment?