Showing posts with label piccoli tesori. Show all posts
Showing posts with label piccoli tesori. Show all posts

Thursday, November 5, 2009

Scrolling content over static background

Scrolling web page content over a static background:

body {background-attachment: fixed}

I just love simple things that do a lot. Or, am I easily amused?...
I used it here.

Thursday, March 26, 2009

bookmark this page

This JavaScript along with the anchor tag allow you to create a quick and easy way to help your viewers bookmark your page.
Click to bookmark this page

<script type="text/javascript">
function favs() {
if ( navigator.appName != 'Microsoft Internet Explorer' ) {
window.sidebar.addPanel(
"Google","http://www.google.com","");
} else {
window.external.AddFavorite(
"http://www.google.com","Google");
}
}
</script>

<a href="javascript:void(favs());">
Click to bookmark this page</a>

Friday, March 6, 2009

JavaScript to disable cut and paste into form fields

// JavaScript to disable cut and paste into form fields

function cutNPasteNot(evt) {
    document.body.ondrag = function () { return false; };
    document.body.ondrop = function () { return false; };
    document.body.oncopy = function () { return false; };
    document.body.onpaste = function () { return false; };
}

Another W3C valid snippet to replace target=...

<a id="sage" href="http://www.sagewebsitedesigns.com/"
    title="Site by Sage Website Designs"
    onclick="window.open(this.href);
    return false;">Sage
</a>

Or, how about:

onclick="return !window.navigate(this.href)"

which will open the new page in the same window...

W3C valid swf embedding

W3C valid swf embedding

<object type="application/x-shockwave-flash"
    data="/flash/sageAdBox.swf"
    width="264" height="180">
    <param name="movie" value="../flash/sageAdBox.swf" />
</object>

From an article in A List Apart Flash Satay

Wednesday, March 4, 2009

JavaScript return false


<a href="#" onclick="func(); return false;">theLinkText</a>

The return false tells the browser that the action of returning
a reference to a
URL should not evaluate. It will instead, return
false
and therefore do nothing with the octothorpe (hey, how
often does one get to use that in a sentence?). This even
works in IE...