Visual Studio type fly out windows in HTML#

I've been working on a project where I wanted to have a flyout window on the left just like how Visual Studio does their menus.

Maybe "slide out" is more accurate.

I used jQuery, which I am trying to use more in my projects, for the effects.

Anyway, I ended up making it a bit harder than it needed to be by having the tab itself slide out, as well as allow for multiple tabs.

At this point I'm happy enough to move on with a successful proof of concept, but I think if I were doing this from scratch again I wouldn't bother having the tab slide out as well.  I'd just show the sliding out window.

But, this should be a good starting point.

visualstudioflyoutmenus.htm (17.7 KB)

Update: And of course it completely fails in FF.

I made some changes, removed some things, tweaked others... looks ok in FF now.

visualstudioflyoutmenus2.htm (17.7 KB)

Categories: Programming | HTML | Javascript
Thursday, October 29, 2009 12:16:37 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Displaying Chart Data With CSS#

Here is a great article about some of the techniques for displaying chart data using CSS.

Examples: http://apples-to-oranges.com/goodies/css-for-bar-graphs/

Categories: Programming | HTML
Sunday, September 21, 2008 7:37:59 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

10 ways to build websites faster#

This is a great article on 10 ways to build websites faster.

They include the obvious ones like using a menu generator, but they also include some cool things like a site from Adobe for selecting color schemes.

Categories: Programming | HTML
Thursday, August 21, 2008 5:04:42 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Highslide#

We have been working with a pretty cool little javascript toolkit called Highslide.

http://vikjavev.no/highslide/

It gives you some nice lightbox type effects but I like it more because of some of the options to load in iframes and stuff.

Someone wrote some asp.net wrappers as well to make it easier to add to your pages:

http://encosia.com/

 

Categories: Programming | .Net | ASP.Net | HTML | Javascript
Thursday, June 05, 2008 4:21:01 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Javascript bookmark to aid with page layout#

A coworker sent me this link.  You just bookmark it, and then click the bookmark when you want to examine the layout of your page elements.

javascript:prefFile='';void(z=document.body.appendChild(document.createElement('script')));void(z.language='javascript');void(z.type='text/javascript');void(z.src='http://slayeroffice.com/tools/modi/v2.0/modi_v2.0.js');void(z.id='modi');

And it will add a little floating window in the upper left corner to show you everything you mouse over:

Categories: Programming | HTML | Javascript
Sunday, March 30, 2008 4:36:06 PM (Central Standard Time, UTC-06:00) #    Comments [1]  | 

 

Using a STYLE block on a page with a Master Page#

I have been asked this a few times, so I decided to write up a little article on it.

The problem is that when you are using master pages in asp.net, the <HEAD> is usually inside the master page template.  So if you are on a page that needs a 1 off change or addition to the style of the rest of the site, you are unable to create a <STYLE> element in your content page.

Well, you CAN create one, but then VS.Net won't show you the designer for your page b/c it keeps asking you to clean up the HTML problems on your page.

The solution I have used is to create a 2nd content place holder in the master page head.  But, I might as well not duplicate effort here, as Rick Strahl has already written the article I am about to write (and apparently, even someone else beat him to the punch).

http://www.west-wind.com/WebLog/posts/5706.aspx

This works very well for this type of situation. 

 

Categories: Programming | .Net | ASP.Net | HTML
Monday, January 14, 2008 7:21:52 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

WebAii Website Automated Testing Framework#

I am always on the lookout for better and easier ways to automate testing of my applications.  Mostly, this stems from my teams not being too keen on implementing testing, so the easier I can make it, the easier it will be to convince others to write tests.

So Phil Haack has suggested a free framework called WebAii, and after taking a quick look, it looks promising.

It supports some nice features like mouse/keyboard actions for Ajax testing, and dom actions (find an element and click it, or whatever).  It also supports unit testing your javascript functions by having your test call the functions.  It also integrates with Nunit.  Nice!

Hopefully I can find some free time (HAHAHHAAH) when I can test this out more in a project.

 

Categories: Programming | .Net | ASP.Net | HTML | Testing
Thursday, January 10, 2008 1:55:44 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Finding the cause for slow loading webpages#

Yahoo has released a tool called YSlow that helps developers identify why a specific website is loading slow.

Take a look at this screen cap (click to enlarge):

 

Categories: Programming | HTML | Javascript | Tools
Tuesday, October 16, 2007 10:18:04 AM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Escaping Characters in MailTo#

I have recently needed to create some more complex mailto links than people normally use.  I need to populate the subject and body with text that is pulled from a DB, so there are lots of random characters in there like @, #, &, -, _, etc...

Most of these won't work, and need to be escaped.

The most effective way I found was to use the ascii HEX code in this format:

%2D = "-"

%45 = "E"

Categories: .Net | HTML
Monday, April 23, 2007 1:38:51 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

MailTo Syntax#

Here is a nice document showing the mailto syntax.

Categories: HTML
Friday, March 30, 2007 3:24:34 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

AJAX and DHTML tools#

This site has some pretty cool links to sites that offer AJAX and DHTML snips and classes.

http://www.miniajax.com/

For example, and pretty cool little Poll thing I might convert from PHP to asp.net/XML:

http://www.dhtmlgoodies.com/index.html?whichScript=ajax-poller

Categories: HTML | Javascript | AJAX
Tuesday, February 27, 2007 2:08:29 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Multi Column Layouts#

Doing Multi-Column layouts can be a real pain some times.

Here are 2 articles that discuss some methods you can employ.

http://www.alistapart.com/articles/multicolumnlayouts

http://blogs.pathf.com/uxd/2006/07/multi_column_la_1.html

 

Categories: HTML
Sunday, February 25, 2007 10:27:44 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Regular Expressions Cheat Sheet#

Here is a cheat sheet that shows some of the main items when using Regular Expressions (RegEx / RegExp)

regular_expressions_cheat_sheet[1].png (80.91 KB)
Categories: Programming | HTML | Javascript | XML
Wednesday, January 31, 2007 1:28:22 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

ObjectSwap does not work with YouTube videos#

Youtube provides a object tag that you can include on your site to show the videos directly, w/o making the user leave your site.

However, I noticed that this object tag was not being activated with the objectswap technique which makes it so you don't have to click on the flash object to "activate" it in IE.

To fix this you need to include the type="application/x-shockwave-flash" in the object definition.

I am not sure why you need this, but if you leave it out, somehow IE removes the object from it's DOM.

If you allow a page to load w/o this "type" and then try to find, using javascript, any OBJECT tags and it will tell you there are none.

 

UPDATE:  Still having some problems... thinking the trick above is causing some new problems.

Categories: Programming | Flash | HTML | Javascript
Friday, January 12, 2007 11:27:29 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Dynamically Resizing an IFrame to Fill The Browser#

If you ever work with an IFrame, you will notice that you can't set height=100%.

But, many times you might want to have an IFrame act as if that property had the desired effect.  i.e. If you make your browser window taller, you want the heigh of your IFrame to grow as well.

You can acheive this using the following script:

       function resize_iframe() {
            var myWidth = 0, myHeight = 0;
            if( typeof( window.innerWidth ) == 'number' ) {
                //Non-IE
                myWidth = window.innerWidth;
                myHeight = window.innerHeight;
            } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                //IE 6+ in 'standards compliant mode'
                myWidth = document.documentElement.clientWidth;
                myHeight = document.documentElement.clientHeight;
            } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                myWidth = document.body.clientWidth;
                myHeight = document.body.clientHeight;
            }
            
            var iNewHeight;
            iNewHeight = parseInt(myHeight)-40;
            document.getElementById("WgipIFrame").style.height = iNewHeight;     
        }

        //-- see if there is already something on the onresize
        var tempOnresize = window.onresize; 
        //-- create our event handler
        window.onresize = function(){ 
            //-- if tempFunc is a function, try to call it
            if (typeof (tempOnresize) == "function"){ 
                try{ 
                    tempOnresize(); 
                } catch(e){} //--- if it errors, don't let it crash our script
            } 
            resize_iframe();
        }

Then you can set the IFrame's onload="resize_iframe();" like this:

<iframe src="x.htm" style="width:100%;" 
  id="WgipIFrame" name="WgipIFrame" 
  onload="resize_iframe();"></iframe>

 

Categories: HTML | Javascript
Tuesday, December 12, 2006 4:46:58 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Finding Browser Window Height #

Here is a nice script, part of a larger section on getting window size/positions and scroll data out of various browsers.  This page really has a lot of good information.

function alertSize() {
    var myWidth = 0, myHeight = 0;
    if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        myWidth = window.innerWidth;
        myHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        //IE 6+ in 'standards compliant mode'
        myWidth = document.documentElement.clientWidth;
        myHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        //IE 4 compatible
        myWidth = document.body.clientWidth;
        myHeight = document.body.clientHeight;
    }
    window.alert( 'Width = ' + myWidth );
    window.alert( 'Height = ' + myHeight );
}
Categories: Programming | HTML | Javascript
Monday, December 11, 2006 4:48:40 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Using window.onload without overwriting existing onload event handlers#

When you are creating reusable javascript files, there are times when you want to tap into the window.onload event, which is fired when the window has finished loading the content.

The problem here, is that you can't have multiple event handlers for the same event.

So if you have a page that uses 2 scripts which both use the window.onload event, then which ever is loaded last will win, and the other script will never catch the event.

Well one way you can deal with this problem is to write your window.onload (or other events for that matter) using this type of a pattern:

    //-- see if there is already something on the onload
    var tempFunc = window.onload; 
    //-- create our event handler
    window.onload = function(){ 
        //-- if tempFunc is a function, try to call it
        if (typeof (tempFunc) == "function"){ 
            try{ 
                tempFunc(); 
            } catch(e){} //--- if it errors, don't let it crash our script
        } 
     //-- Call your onload function here
    }

This way, you can have several function that all utilize the onload event, and none of them have to know about each other.

 

Categories: HTML | Javascript
Tuesday, December 05, 2006 3:33:52 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Adding return values to SubModal#

A while back I blogged about SubModal, a little tool for creating nice modal dialogs on websites.

One of the things I wanted to do was have the modal dialog return a value, like the showModalDialog does in IE.

To achieve this, follow these instructions.

In your "main" html page, declare a callback function and a button that will launch the modal dialog:

    function myFunction(val){
        alert("Return value is...");
        alert(val);
    }

Then create an input button to launch the modal dialog.

<input type="button" onclick="showPopWin('modalcontent.html', 400, 200, myFunction);" />

Then, in the submodalsource file, or where ever you have your JS stored, change this function to include a return value, and have it use it.

/**
 * @argument callReturnFunc - bool - determines if we call the return function specified
 * @argument returnVal - anything - return value 
 */
function hidePopWin(callReturnFunc, returnVal) {
    //alert(callReturnFunc);
    gPopupIsShown = false;
    restoreTabIndexes();
    if (gPopupMask == null) {
        return;
    }
    gPopupMask.style.display = "none";
    gPopupContainer.style.display = "none";
    if (callReturnFunc == true && gReturnFunc != null) {
        // edited by CDM -- gReturnFunc(window.frames["popupFrame"].returnVal);
        gReturnFunc( returnVal );
    }
    gPopFrame.src = gLoading;
    // display all select boxes
    if (gHideSelects == true) {
        displaySelectBoxes();
    }
}

Then finally on your modal page, just some code to close the window, and pass back the return value.

<button onclick="window.parent.hidePopWin(true, 'I am the return value')">close</button>
Categories: Programming | HTML | Javascript
Wednesday, November 29, 2006 4:06:50 PM (Central Standard Time, UTC-06:00) #    Comments [2]  | 

 

The top 10 mistakes when using AJAX#

Here is an interesting list of the top 10 things people do wrong when using AJAX.

http://weblogs.asp.net/mschwarz/archive/2006/11/20/the-top-10-mistakes-when-using-ajax.aspx

  1. Don't use AJAX to update the complete page by putting everything in a UpdatePanel. You want to save time and traffic when running the web page. Never update parts of the web site that can be changed using JavaScript and DHTML (DOM).
  2. Have in mind that there are a couple of visitors that have JavaScript disabled or using a web browser with an older or less JavaScript implementation like the most mobile devices have. What does your visitor see if everything is disabled? I don't recommend to have the full web site available as a JavaScript disabled version!
  3. Cache the same requests on client-side web browser or implement any caching on the web server. The most used scenarios like AutoComplete or DropDown fields are filled everytime the same. A wrong written AutoComplete can slow down your web server (database server) because there more requests done than the version before using PostBacks. Think of pressing F5 (reload) all the time with your old web site. If you have cascading DropDown you can save more traffic/requests!
  4. Don't run concurrent or long running AJAX requests when using CSS or JavaScript to change the UI. There are only two concurrent http connections possible with all common web browsers (I know you can change this, but the default behavior is set to two). If there are running to many AJAX requests running loading of images will be slow down.
  5. Use everytime the asynchrouns invoke of the send method of XMLHttpRequest. There is no issue where you want to use the synchronous one. Your web browser will not be forozen when having network problems or slow connections.
  6. Try your web application using a very slow internet connection. Try it again using a TCP/IP connection with a very high latency for each paket.
  7. Is your web application running as a desktop replacement? Have a look at the memory usage of common web browsers if you run your application one hour, two hours or couple of days. Not everybody has a development machine like yours!
  8. Check the http status code you will get back from XMLHttpRequest. There are a couple of common network errors like DNS not available, http server error 500. Did you ever checked for the status code which tells you if your web browser is in offline mode?
  9. Try to disable the XMLHttpRequest object! With IE7 you can use the native object instead of the ActiveX object, but you can still disable the native object, too.
  10. Check your AJAX requests for security issues! Did you simple open all your data access layers? Make use of FormsAuthentication and PrincipalPermissions on ASP.NET. Can anybody create requests (not only by clicking on a link)?
Categories: Programming | AJAX | HTML | Javascript
Thursday, November 23, 2006 9:19:08 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Getting IE To Print Backgrounds And Cell Colors#

I was having a small problem getting some reports to print the way I wanted.

I turns out that to get the table cells colored backgrounds to print, click on the browser’s Tools menu. Select Internet Options, then click on the Advanced tab. Scroll down to find the Printing heading and check the box called Print Background Colors and Images. This setting affects both page backgrounds and table cell backgrounds.

Categories: Programming | HTML
Saturday, August 26, 2006 6:57:53 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

5 Rarely used XHTML elements#

This article is pretty interesting, as it discusses 5 xhtml elements that most people don't know about or use.

1) OptGroup





 
2) label (click the "Full Name")

Gender: 

 

3) fieldset/legend

CommentsCP is a good place to publish XHTML related articles.
www.google.com can search

Personal Information Gender: 

4) col/colgroup (notice the control over col widths)

1   2
3   4

 

5) Acronym (mouse over xhtml)

CP is a good place to publish XHTML related articles.

 

These are not widely known but very useful.

Categories: Programming | HTML
Wednesday, May 24, 2006 1:15:47 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

AWStats#

This is a well known log analyzer application that can provide a nice web interface for viewing we stats.

http://awstats.sourceforge.net/ 

Categories: Networking | Hosting | Programming | HTML | Tools
Thursday, May 04, 2006 3:55:16 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Fixing Left Column Problem With dasBlog Essence Theme#

I got a response back from Jelle Druyts regarding the problem where the left column falls off the page if you narrow the window enough.

He was kind enough to respond with his CSS changes:

/*----- Content Styles -----*/

#content {
        margin-top: 10px;
        position: relative;
        top: 0px;
}

#bodyContainer {
        margin-left: 220px;
}

/* Exceptions for Print */
@media print {
        #bodyContainer {
                width: 100%;
                margin-left: 0px;
        }
}

(...A little later...)

pre {
        overflow-x: scroll;
}

(...A little later...)

#metaContainer {
        border: 1px dashed #d0d0d0;
        background-color: #f0f0f0;
        color: #505050;
        font-size: smaller;
        width: 210px;
        position: absolute;
        top: 0px;
}

Once you apply these to the dasBlog.css file in the Essence theme package, the left column will remain in place!  Excellent!

Categories: Blogging | dasBlog | HTML
Saturday, April 22, 2006 4:28:59 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

Screen Scraping Email Blocker#
This article shows how to create a control that will convert your email addresses into a unique code that is reconverted by javascript when the page loads... so it can't be screen scraped.
Categories: Code Links | Email | Programming | .Net | ASP.Net | HTML | Javascript | Security
Saturday, March 13, 2004 9:37:02 PM (Central Standard Time, UTC-06:00) #    Comments [1]  | 

 

More Info on IIS6 HTML Compression#
IIS6 HTML Compression seems to be either unimpressive or mis-configured (by myself).

This is some documentation that I am going to need to look at...
Categories: Code Links | Programming | HTML | IIS
Tuesday, January 13, 2004 10:40:42 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Floating Table Headers#
Here is a newsgroup posting that shows an example for floating table headers.
Categories: Programming | HTML | Web Site Links
Monday, December 15, 2003 8:41:20 PM (Central Standard Time, UTC-06:00) #    Comments [1]  | 

 

Scrolling Datagrid#
For $10 these guys are selling a scrolling datagrid that extends the existing datagrid.

Pretty cool, and cheap.
Categories: Programming | .Net | ASP.Net | HTML | Javascript | Tools
Friday, December 05, 2003 9:31:59 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Nice Javascript Menu Generator#
Here is a pretty nice, and free, javascript menu generator.

Works with a range of browsers (even opera).
Categories: Programming | HTML | Javascript | Tools
Tuesday, November 25, 2003 12:59:05 PM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Remove extra line in UL and OL#
To remove the extra line in ordered lists and unordered lists (UL OL), just apply style="margin-top: 0px;"
Categories: Programming | HTML
Tuesday, November 25, 2003 1:51:57 AM (Central Standard Time, UTC-06:00) #    Comments [0]  | 

 

Sending Data as an XML/HTML Excel Document#
This article shows how to send data as an xml/html Excel document. The user can then view it in IE, or choose to edit it in Excel (all functions come along when you do the Excel editing.
Categories: Programming | .Net | ASP.Net | HTML | XML
Wednesday, November 05, 2003 10:40:51 AM (Central Standard Time, UTC-06:00) #    Comments [1]  | 

 

Cool Menu#
This is a pretty cool menu creator. Again, it's kinda expensive ($100 or so), but looks good.
Categories: Programming | HTML | Javascript | Tools
Wednesday, September 17, 2003 2:52:25 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

HTML Codes#
I was looking for some hard to find HTML Codes. Found a good reference here.
Categories: Code Links | Programming | Web Site Links | HTML | References
Sunday, June 15, 2003 10:36:54 PM (Central Daylight Time, UTC-05:00) #    Comments [0]  | 

 

All content © 2010, Christopher May, Inc
Open Job Positions
On this page
Google Ads
This site
Calendar
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Archives
Sitemap
Blogroll OPML
Disclaimer

Powered by: newtelligence dasBlog 2.3.9074.18820

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts


Pick a theme: