PDA

View Full Version : javascript inside a css page?



ralphiedee
Mar 19th, 2009, 05:06 PM
I have a client who is looking for the same effect for his homepage. After looking at the page source of the example

http://www.shihofukada.com/main.php

It looks like the page was done with javascript. Can someone point me in the right direction?

rdee

abduraooft
Mar 19th, 2009, 05:08 PM
It looks like the page was done with javascript.
That page is made up of flash.

drhowarddrfine
Mar 19th, 2009, 05:11 PM
No, it was done with flash.

VIPStephan
Mar 19th, 2009, 05:13 PM
Yeah, it’s Flash that is embedded through (terrible) JavaScript. While pure Flash websites (without proper alternative content) are a bad idea anyway this website it beating everything in terms of bad practice. A better and more current way of embedding a Flash object in an HTML document is SWFObject (http://code.google.com/p/swfobject/).

ralphiedee
Apr 1st, 2009, 04:20 AM
Guys it seems I'm right back where I started as I still need to do a layout that is like the one in question. I know how to make an swf resize with the browser but if you look at the page you will see the top (or header is NOT a Flash movie) if you resize the browser the header content remains the same.

I was able to get the javascript from the page

/**
* Resize the current browser window to fill the screen.
*/
function sizeToFitScreen(){
if (!safari){
var winToMove = top.window;
} else {
var winToMove = self;
}
if (document.all || safari) {
var w = screen.availWidth;
var h = screen.availHeight;

// Account for the fact that IE on Mac does not include the dock
// in the availHeight property. Have to guess that it's approximately
// 80 pixels high and is visible.
if (mac && !safari){
h -= 80;
}
winToMove.moveTo(0,0);
winToMove.resizeTo(w,h);

} else if (document.layers || document.getElementById) {
if (winToMove.outerHeight < screen.availHeight || winToMove.outerWidth < screen.availWidth){
winToMove.outerHeight = screen.availHeight;
winToMove.outerWidth = screen.availWidth;
}
winToMove.moveTo(0,0);
}
}

Then there is the Flash object

objEmbedTag = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="100%" HEIGHT="100%" id="proxy" ALIGN="">';
objEmbedTag += '<PARAM NAME=movie VALUE="' + baseURL + '">';
objEmbedTag += '<PARAM NAME=flashvars VALUE="' + flashVars + '">';
objEmbedTag += '<PARAM NAME=quality VALUE=high>';
objEmbedTag += '<PARAM NAME=bgcolor VALUE=#' + bgColor + '>';
objEmbedTag += '<PARAM NAME=scale VALUE="noscale">';
objEmbedTag += '<PARAM NAME=salign VALUE=LT>';
objEmbedTag += '<PARAM NAME=AllowScriptAccess VALUE="always">';
objEmbedTag += '<EMBED src="' + baseURL + '" AllowScriptAccess="always" flashvars="' + flashVars + '" quality=high bgcolor=#' + bgColor + ' WIDTH="100%" HEIGHT="100%" scale="noscale" salign=LT NAME="proxy" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED></OBJECT>';
document.write(objEmbedTag);