Friday, April 30, 2010
IE7 and linked CSS files
Looks like IE7 doesn't distinguish between two linked CSS files if they have the same file name. I think it's ignoring the second one. Fixed by renaming the 2nd one.
Friday, April 23, 2010
Cool Flash-based tag clouds
- First saw it on idesignyoureyes.com
- XML-driven one here
- Roy Tanck's WP-Cumulus tag cloud is the basis for the Blogumus Animated Flash tag cloud widget for Blogger
http://www.roytanck.com/wp-content/plugins/wp-cumulus/tagcloud.swfand replace the URL for swfobject.js to:
http://www.roytanck.com/wp-content/plugins/wp-cumulus/swfobject.js
On this blog, the widget code is:
<b:widget id='Label99' locked='false' title='Label Cloud' type='Label'>
<b:includable id='main'>
<b:if cond='data:title'>
<h2><data:title/></h2>
</b:if>
<div class='widget-content'>
<script src='http://www.roytanck.com/wp-content/plugins/wp-cumulus/swfobject.js' type='text/javascript'/>
<div id='flashcontent'>Blogumulus by <a href='http://www.roytanck.com/'>Roy Tanck</a> and <a href='http://www.bloggerbuster.com'>Amanda Fazani</a> via <a href='http://bloggerstop.net'>BloggerStop.Net</a></div>
<script type='text/javascript'>
var so = new SWFObject("http://www.roytanck.com/wp-content/plugins/wp-cumulus/tagcloud.swf", "tagcloud", "200", "200", "7", "#DDDDAA");
so.addParam("wmode", "transparent");
so.addVariable("tcolor", "0x5588AA");
so.addVariable("mode", "tags");
so.addVariable("distr", "true");
so.addVariable("tspeed", "100");
so.addVariable("tagcloud", "<tags><b:loop values='data:labels' var='label'><a expr:href='data:label.url' expr:style='8 + data:label.count'><data:label.name/></a></b:loop></tags>");
so.addParam("allowScriptAccess", "always");
so.write("flashcontent");
</script>
<b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>
Wednesday, April 21, 2010
Cross-browser CSS Gradient
This cross-browser CSS gradient also works on IE6.
Cannot reset hasLayout for display:inline-block
Learned (to my horror) that, on IE7, using display:inline-block sets hasLayout=true, and that resetting display to inline does not also reset hasLayout. There's no way to reset it in this case. You can "!important" all you want and it won't work. See this article about hasLayout. This is one case when IE6 behaved better than IE7.
[I was having issues with SharePoint 2010's core CSS setting display:inline-block on the current breadcrumb span element. I adjusted the styles so the crumbs were shown in the usual linear manner (as opposed to a folder structure), but long crumb text ended up as an inline-block instead of wrapping properly to the next line. To get around it (without changing the core CSS), I added some jQuery to change the class attribute of the element to something else, just so the inline-block didn't get applied to the element anymore. And then realized later that modifying the ListSiteMapPath to use a different value for CurrentNodeStyle-CssClass will accomplish the same thing.]
[I was having issues with SharePoint 2010's core CSS setting display:inline-block on the current breadcrumb span element. I adjusted the styles so the crumbs were shown in the usual linear manner (as opposed to a folder structure), but long crumb text ended up as an inline-block instead of wrapping properly to the next line. To get around it (without changing the core CSS), I added some jQuery to change the class attribute of the element to something else, just so the inline-block didn't get applied to the element anymore. And then realized later that modifying the ListSiteMapPath to use a different value for CurrentNodeStyle-CssClass will accomplish the same thing.]
Wednesday, April 14, 2010
Image preloading
Several articles at Perishable Press.
And the filament group's jQuery plugin to preload images from CSS stylesheets.
And the filament group's jQuery plugin to preload images from CSS stylesheets.
Saturday, April 10, 2010
Lightbox jQuery Plugin
Fancybox is a jQuery plugin for displaying content (images, video, etc) in a lightbox. Simple to use. And can display YouTube videos (see the tips & tricks page).
Wednesday, April 7, 2010
Strip HTML tags from strings
Strip HTML tags from a string using regular expressions.
Research and test alternative regular expressions at the Regex Library.
Research and test alternative regular expressions at the Regex Library.
Intellisense slows down Visual Studio
I've seen this happen on VS2008 and VS2010--it can take a looong time to open a master page, depending on what's on it. Found how to disable jScript intellisense from this discussion.
For VS2010, see Scott Guthrie's article about an Intellisense patch.
For VS2010, see Scott Guthrie's article about an Intellisense patch.
Thursday, April 1, 2010
Script to get query string
From the answers here (which refers to this article):
// Get the query parameter string.
// Usage: If URL is "blah.com/index.html?view=classic", then do this to get the value of "view":
// var parm = $.urlParam('view');
// See http://stackoverflow.com/questions/901115/get-querystring-with-jquery.
$.urlParam = function (name) {
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (!results) { return 0; }
return results[1] || 0;
};
Subscribe to:
Posts (Atom)