MainelyDesign.com Blog

Jquery Tagged Blog Posts

Get All Active jQuery UI Dialog Windows, then Close 'Em

Posted on 03/21/2013 at 02:36 pm | Viewed 13,792 times | 0 comments

I had a need to close all active jQuery UI dialogs on the page (yes, I have more than 1 open at a time!).  You may think it's as easy as calling $('.ui-dialog').dialog('cose') but you'll throw an error.  The way I've figured out how to do it (jquery UI 1.10) is pretty simple, really:

Close all Active jQuery UI Dialog Windows

jQuery UI 1.10 Tabs - Using Aria-Controls to Set the URL of a Tab

Posted on 03/18/2013 at 01:00 pm | Viewed 74,353 times | 0 comments

I continue to find things that I overlooked on my upgrade to using jQuery UI 1.10.  This time it was the tabs API changes that got me. 

No more show(); Now use activate();

The first change that really did me in ("why aren't any of my tabs executing my show callback function???") was the elimination of the show() callback.  This callback used to be fired-off each time a panel was displayed.  The change is easy, just rename your callback to activate:

Best Approach to Dynamic Javascript in CakePHP Views

Posted on 05/29/2010 at 12:36 pm | Viewed 16,738 times | 5 comments

I always knew in the back of my mind that there was a better way of creating dynamic javascript than the method I was using.  CakePHP has a great function as part of the $View controller:  $View->addScript($jscript, false) will add a script block to your template header.  This is the command I use to send javascript created in a Cake view up to the header, which is where most javascript should live.  The best approach to adding dynamic javascript to your CakePHP views is to implement PHP's output buffering, combined with $View->addScript().

Using Jquery for target="_blank" and strict xHTML

Posted on 12/28/2009 at 03:27 pm | Viewed 11,247 times | 0 comments

If you like to see the little green check mark that HTML Validator shows when your HTML is 100% valid, you'll love this little trick. Thanks to badlydrawntoy.com

Upgrading Jquery UI Tabs and it Stopped Working

Posted on 12/09/2009 at 08:16 pm | Viewed 8,257 times | 0 comments

I was upgrading the version of Jquery UI that I use with Site Avenger.  The last time I was in a rush, nothing seemed to work and I rolled the changes back.  This time, I took the time and decided to finally make this Jquery UI upgrade happen.  This time everything went swell, except my Jquery UI tabs plugin stopped working.  WTF?

Jquery Accordion Menu - Expanding UL Menu

Posted on 11/17/2009 at 01:25 pm | Viewed 26,767 times | 0 comments

I looked around and found some interesting examples and existing plugins for creating an accordion menu in Jquery.  What I was looking for was a nested unordered list (UL) that would collapse and expand based on which menu item was clicked.  If there wasn't a child UL, then the menu link should be clickable, instead of an accordion.  Sounds simple right?

Jquery Direct Descendant Selector (using the >)

Posted on 11/17/2009 at 01:08 pm | Viewed 10,811 times | 0 comments

I'd been struggling with a very simple accordion menu script.  The problem was that I couldn't stop all of the links from returning false, when I only wanted to top link to return false.  Let me show you my code:

$('div#sideNav li:has(ul) a').click(function() {
	return false;
});

Auto Columns with Columnizer - My New Favorite Jquery Plugin

Posted on 09/30/2009 at 10:37 am | Viewed 16,039 times | 2 comments

I was about to start coding a CakePHP helper that would analyze a bulleted list and split it into columns.  Starting to think about how I would approach this problem, my head began to hurt.  Then I found an awesome jQuery plugin- columnizer.

Changing Filetypes Shown in SWF Upload File Browser

Posted on 08/25/2009 at 04:17 pm | Viewed 11,211 times | 0 comments

It's easy to change which file types are allowed to show up (and are displayed) when you browse for files to upload through SWF Upload.  SWF Upload makes it easy to upload multiple files in PHP.

I just had to hunt through some source files until I found this in my SWF Upload config. (goes in the new SWFUpload() function)

Full Tag List

Meet Site Avenger - Hosted Content Management System

Powered By: Site Avenger | Site Production: Saco Design