Creative Notice

exploring creativity 

jQuery 1.3.2 Toggle Element Issue

So here's a little obscurity I ran across in using jQuery 1.3.2 to affect effects on an unordered list.

Here's what I've got:

<!doctype html>
<html>
    <head>
        <script>
            $(".bb_qlist_title").click(function(){
                $(this).siblings('ul').slideToggle(function(){
                    var visible = $(this).is(':visible');
                    if( visible ){
                        $(this).siblings('h4').css('background-image', -->
                            'url(lib/images/content/icons/bullet_arrow_down.png)');
                    }else{
                        $(this).siblings('h4').css('background-image', -->
                            'url(lib/images/content/icons/bullet_arrow_up.png)');
                    }
                });
            });
        </script>
    <head>
    <body>
        <ul>
            <li><h4>Title</h4>
                <ul>
                    <li>menu item</li>
                    <li>menu item</li>
                    <li>menu item</li>
                 </ul>
            </li>
        </ul>
    </body>
</html> 

Pretty streight forward you'd say. We're building a list and sub-list. The sub-list get's slid up when the user clicks on the h4 element. We're also wanting to change a background-image of the h4. In this case the images used are up and down arrows.

But here's the kicker, the above code will not work. The problem line is "var visible = $(this).is(':visible');". Here's what's going on.

The UL that contains our sub-list elements has no box size. In jQuery 1.3.2 the toggle methods no longer look at the CSS visibility of an element, but rather the visible area that element takes up on the page. Since the UL doesn't take up any area, the above line is always false.

Now there are two ways around this pickle.

  1. If like you could give the sub-list UL some dimensions.
  2. or we can just watch for it's children.

The 2nd option seams the most rhobust to me since we don't know how many list items our sub-list will hold, so setting a height is not an option.

So the simple fix is to change this line:
var visible = $(this).is(':visible');
to this line:
var visible = $(this).children('li').is(':visible');
We're now watching the sub-lists children LIs which do take up physical space on the page and jQuery 1.3.2 can see them.

Loading mentions Retweet

Comments [0]

Google Chrome Quick Tips

So here's some cool things you can do with Google Chrome. Obviously this is not a complete list, just something I stumbled on, so please add your own quick tips in the comments.

  1. Ctr-click the address bar arrow to open current url in a new tab.
  2. Ctr-click address bar arrow to open current url in new window.
Enjoy.

Loading mentions Retweet

Comments [0]

Find Your Ubuntu Version From Command Line

Just a quick note. To find the version of Ubuntu you are using type the following in console.

cat /etc/lsb-release

Which will output something like

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.10
DISTRIB_CODENAME=intrepid
DISTRIB_DESCRIPTION="Ubuntu 8.10"

Loading mentions Retweet

Comments [0]

How to Find GoDaddy Hosting File Path

If you ever have the ill-fated reason to work with GoDaddy hosting. You may find it difficult to find the full file path of your account.

This happened to me just now. I moved a development version of Wordpress to a client's GoDaddy hosting account only to learn that the file path was no where to be found. After some digging I finally found a description of how the file path is constructed.

This help document is related to .htpasswd location, but its description of the file path is correct. Note you may have to be logged into your GoDaddy hosting account to read this.

http://help.securepaynet.net/article/1641?prog_id=424050

Loading mentions Retweet

Comments [0]

Thoughts on the Maturing Digital Age

It's happening to an entire generation of tech savvy people; the increasing amount of available data is starting to be arranged in a manageable way. On my laptop I'm now combining my Twitter and Facebook feeds. Images, audio and video are starting to be shared through common channels. It's to early to proclaim the age of the web site is over, but we can certainly see a fore shadow of such a time as we increasingly pull our digital world into simple apps that manage our interactions for us. Simplicity is the key here and web apps are maturing quite well.

So what does this mean for the mobile phone industry? It means consumers are starting to expect that same functionality on their mobile device, not just the computer. Take me for example. I have a Google Voice number that rings my mobile and my Skype account. Call records and voice mail is all contained in my Google Voice account. My contact list is synced between all my Google accounts (docs, gmail, etc) and my mobile phone.

This hodge podge of technologies is just the beginning. I full expect mobile providers to provide better integration in the future. Imagine a mobile device that natively syncs all your contact lists, news feeds, social media channels. The Palm Pre is a big step in the right direction as WebOS does a pretty nice job integrating your contacts, etc.

So what's missing? The complete syncronization of data into the cloud. I should be able to fully access my contacts, voice mail, call history, documents, etc. from any platform, mobile or desktop, Windows or Apple.

Loading mentions Retweet

Comments [0]

Google UI Update in Suggested Search

Not only did Google just update their homepage search box and buttons, but they added an interesting placement for their "Google Search" and "I'm Feeling Lucky" buttons.

Now when you start typing a search phrase you will notice a new UI for the suggested search drop down. Both buttons appear inside the search suggestion drop down. Also, clicking one of the suggestions will start the search for that phrase.

Now I understand the click to search feature, that's rather handy. But adding the search buttons baffles me. How are they helpful?

Loading mentions Retweet
Filed under  //   google   search   search engine   ui  

Comments [0]

Quick Tip #1: Don't use a containing div.

I'm always looking for ways to simplify my HTML, especially as I move ever closer to HTML5. So today's tip will, I hope, prod you to stop using extra markup you really don't need.

Body of Lies
The most common over use of the div tag is to surround page content in order to limit the page width. You will find these container layers are named things like #content, #container, #page, etc. I submit to you this is a duplication of effort since we can do the same thing with the body.

body { width: 960px; margin: 0 auto; } works just as well on the body tag as it does an extra div. After all, body is already containing the, well, the body of our document.

Don't Fence in Your Lists
Did you know the unordered and ordered lists are in fact block elements? That's right, their on the same level as a div, so don't surround them in a div then you can define the list in the same way. Consider this code:

.nav {width:100%;background:#ff0;}
.nav ul {margin:0;list-style:none;}
.nav ul li {float:left;}
<div class="header">
    <div class="nav">
        <ul>
            <li>Home</li>
        </ul>
    </div>
</div>

It's not so bad right? Sure it's functional, but is it efficient use of space? I submit you can accomplish the same thing like this:

.header > ul {width:100%;background:#ff0;margin:0;list-style:none;}
.header > ul li {float:left;}
<div class="header">
    <ul>
        <li>Home</li>
    </ul>
</div>

So simplify your work life by thinking about how to use HTML elements to their full potential. Your thoughts and ideas are greatly appreciated. 

Loading mentions Retweet
Filed under  //   containers   div   divs   html   html5  

Comments [0]

How I Manage Projects

I came to a realization, some time ago: I'm just not a natural at project management. Yet it is an essential skill we must have so here's what I've done to compensate.

Pre-planning: Think of this as a todo list on steroids. I pre-plan every project to the fullest extent possible. I write down every task and it's dependencies and map out a plan of action with deliverables for myself and the client. The goal is to so thoroughly plan that I can just follow the step by step actions "work the plan" and achieve frequent milestones. When I'm in production mode I don't want to think about the next step. I want to focus exclusively on that task.

Plan the day: I use a notebook from Franklin-Covey to plan my day. I'm very specific about this planner because it helps me plan by task importance, not by time. Since I have my projects pre-planed, I can now break those down and tackle multiple tasks across multiple projects throughout the day, all organized in one planner. I also intersperse other tasks, like writing proposals, phone calls, emails, etc. throughout the day, all listed by importance.

Cut out the noise: This one I still have trouble with, as is evidenced by the fact that I'm writing this post while I should be working ;-). I manage emails like a fiend, I only check mail once a day. If a client's matter is so important it can't wait till 9am, then they can call. When I do get a call, I try to ascertain the calls importance within the first 20 seconds. If it's not absolutely pressing I'll put the call off, "Hey Stan, I'm working with a client right now, let me call you back at 2."

Twitter and Facebook are also noise, the kind that are hard to cut out because I've gotten real work from both channels. But they can sneak in and steal the day so I set 5-10 minute segments of time to check them, and I check them as a business tool... in and out. The goal being to glean some quick insights from those I follow, bookmark some links to follow up on later, and share some helpful thoughts with my followers. Then it's back to work.

The break: This is the absolute hardest for me... taking a real break, away from the PC. As work grows and dependencies mount, I tend to skip breaks, sometimes even lunch, to try and get ahead. What happens though is after two days of 8+ straight hours of work I get burned out and spend the next three days procrastinating. So my goal is 15 minutes off the PC every 2 hours, and 1 hour for lunch. Think about it, it's not that time expensive. If you take 15 minutes at 10am, 2pm and 4pm, plus 1 hour at lunch, that's 1:45 of break, multiply by your hourly rate. Is that dollar amount worth your sanity? It is for me.

Self awareness: This is the absolute most important thing to grasp. You are not perfect and you were not designed to multi-task.Period. Our modern society puts great value on multi-tasking, but that's only a recent development. It's something computers do well, but it's not a human trait. I'm a perfectionist and have a very healthy ego as well so getting over the self-inflicted idea that I should be all things to all people in all situations has been a real struggle for me. I imagine it is for quite a few freelancers. The point is, know your limitations and be ok with them. Don't settle for them, but be ok with them; and then go and work around them.

So what do you do? How do manage the free thinking, mold breaking monster?

Loading mentions Retweet
Filed under  //   franklin-covey   planing   planner   planning   pm   project   project management  

Comments [4]

Missing List Items in IE

So I've come across this a few times, I like to remove the margins on my html lists so the bullet sits outside the text block. This is just appropriate, looks great and makes for much easier to read copy.

Sometimes though, IE just hides the bullets. So the less-than-graceful work around is to use display:inline on the ul or ol.
This lets the bullet show outside the block in FireFox and moves the list items inside the block in IE.

Not pretty but functional.

   
Click here to download:
Missing_List_Items_in_IE.zip (17 KB)

Loading mentions Retweet

Comments [0]

Using Flash Pro Encoder 8 on Vista

If you are like me, and do very little Flash work, you probably have an older version of Flash Pro and the included FLV encoder.

Imagine my horror in finding that Flash 8 Video Encoder wouldn't run under Windows Vista! I kept getting an error saying:
Failed to install ISKernel Files. Make sure you have appropropaite privileges on this machine.
Scary since I have a client who actually needs an M4V converted to FLV.

I did finally get things working, and the solution was surprisingly simple.
  1. Navigate to c:/Program Files (x86)/Macromedia/Flash 8 Video Encoder.
  2. Right-click the video encoder exe and select properties.
  3. Click the Capabilities tab, then check Run as Administrator.
Simple as that. Enjoy your resurrected FLV encoder.

Loading mentions Retweet

Comments [0]