Tuesday, July 21, 2009
How to impliment fullscreen flash html in browser
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<title></title>
<style type="text/css">
body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
}
body {
background-color: #000000;
}
</style>
<script language="JavaScript" type="text/javascript">
<!--
// -----------------------------------------------------------------------------
// Globals
// Major version of Flash required
var requiredMajorVersion = 10;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Revision of Flash required
var requiredRevision = 0;
// the version of javascript supported
var jsVersion = 1.0;
// -----------------------------------------------------------------------------
// -->
</script>
<script language="VBScript" type="text/vbscript">
<!-- // Visual basic helper required to detect Flash Player ActiveX control version information
Function VBGetSwfVer(i)
on error resume next
Dim swControl, swVersion
swVersion = 0
set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))
if (IsObject(swControl)) then
swVersion = swControl.GetVariable("$version")
end if
VBGetSwfVer = swVersion
End Function
// -->
</script>
<script language="JavaScript1.1" type="text/javascript">
<!-- // Detect Client Browser type
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
// NS/Opera version >= 3 check for Flash plugin in plugin array
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
descArray = flashDescription.split(" ");
tempArrayMajor = descArray[2].split(".");
versionMajor = tempArrayMajor[0];
versionMinor = tempArrayMajor[1];
if ( descArray[3] != "" ) {
tempArrayMinor = descArray[3].split("r");
} else {
tempArrayMinor = descArray[4].split("r");
}
versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
} else {
flashVer = -1;
}
}
// MSN/WebTV 2.6 supports Flash 4
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
// WebTV 2.5 supports Flash 3
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
// older WebTV supports Flash 2
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
// Can't detect in all other cases
else {
flashVer = -1;
}
return flashVer;
}
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
reqVer = parseFloat(reqMajorVer + "." + reqRevision);
for (i=25;i>0;i--) {
if (isIE && isWin && !isOpera) {
versionStr = VBGetSwfVer(i);
} else {
versionStr = JSGetSwfVer(i);
}
if (versionStr == -1 ) {
return false;
} else if (versionStr != 0) {
if(isIE && isWin && !isOpera) {
tempArray = versionStr.split(" ");
tempString = tempArray[1];
versionArray = tempString .split(",");
} else {
versionArray = versionStr.split(".");
}
versionMajor = versionArray[0];
versionMinor = versionArray[1];
versionRevision = versionArray[2];
versionString = versionMajor + "." + versionRevision;
versionNum = parseFloat(versionString);
if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
return true;
} else {
return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );
}
}
}
return (reqVer ? false : 0.0);
}
// -->
</script>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
<link rel="Shortcut Icon" href="/favicon.ico">
<script language="JavaScript" type="text/javascript">
<!--
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) {
var oeTags = '<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">'
+ '<tr>'
+ '<td width="100%" height="100%">'
+ '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
+ 'width="100%" height="100%"'
+ 'codebase="http://get.adobe.com/flashplayer/">'
+ '<param name="movie" value="loader.swf" /><param name="menu" value="false" /><param name="quality" value="high" />'
+ '<embed src="loader.swf" menu="false" quality="high"'
+ 'width="100%" height="100%" name="index" align="middle"'
+ 'play="true"'
+ 'loop="false"'
+ 'quality="high"'
+ 'allowScriptAccess="sameDomain"'
+ 'type="application/x-shockwave-flash"'
+ 'pluginspage="http://get.adobe.com/flashplayer/">'
+ '<\/embed>'
+ '<\/object>'
+'</td>'
+ '<td><div align="center"><img src="html_img/1x600.jpg" width="1" height="600"></div></td>'
+ '</tr>'
+ '<tr>'
+ '<td><div align="center"><img src="html_img/900x1.jpg" width="900" height="1"></div></td>'
+ '<td></td>'
+ '</tr>'
+ '</table>';
document.write(oeTags);
} else {
document.write('This content requires the Macromedia Flash Player.<a href="http://get.adobe.com/flashplayer/">Get Flash Player 10</a>');
}
// -->
</script>
<script type="text/javascript">
objects = document.getElementsByTagName("object");
for (var i = 0; i < objects.length; i++)
{
objects[i].outerHTML = objects[i].outerHTML;
}
</script>
<noscript>
This content requires the Macromedia Flash Player.
<a href="http://www.macromedia.com/go/getflash/">Get Flash</a>
</noscript>
</body>
</html>
Thursday, June 4, 2009
jquery - Create rollover image buttons | make rollover image buttons from single function using jquery
$(document).ready(function() {
if (!$.browser.msie || ($.browser.msie && $.browser.version > 6)) { //if not ie6 png buttons
//png button
$("img.button").hover(
function () {
ori = $(this).attr("src").split(".png");
src = ori[0];
$(this).attr("src",src + "_over.png");
},
function () {
$(this).attr("src",src + ".png");
}
);
}
//jpg button
$("img.jpgBtn").hover(
function () {
ori = $(this).attr("src").split(".jpg");
src = ori[0];
$(this).attr("src",src + "_over.jpg");
},
function () {
$(this).attr("src",src + ".jpg");
}
);
});
Wednesday, April 29, 2009
Useful HTML Meta Tags
Tag Name | Example(s) | Description |
Author | <META NAME="AUTHOR" CONTENT="Tex Texin" /> | The author's name. |
cache-control | <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE" /> | HTTP 1.1. Allowed values = PUBLIC | PRIVATE | NO-CACHE | NO-STORE. Public - may be cached in public shared caches Private - may only be cached in private cache no-Cache - may not be cached no-Store - may be cached but not archived The directive CACHE-CONTROL:NO-CACHE indicates cached information should not be used and instead requests should be forwarded to the origin server. This directive has the same semantics as the PRAGMA:NO-CACHE. |
Content-Language | <META HTTP-EQUIV="CONTENT-LANGUAGE" CONTENT="en-US,fr" /> | Declares the primary natural language(s) of the document. May be used by search engines to categorize by language. |
CONTENT-TYPE | <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8" /> | The HTTP content type may be extended to give the character set. It is recommended to always use this tag and to specify the charset. |
Copyright | <META NAME="COPYRIGHT" CONTENT="© 2004 Tex Texin" /> | A copyright statement. |
DESCRIPTION | <META NAME="DESCRIPTION" CONTENT="...summary of web page..." /> | The text can be used when printing a summary of the document. The text should not contain any formatting information. Used by some search engines to describe your document. Particularly important if your document has very little text, is a frameset, or has extensive scripts at the top. |
EXPIRES | <META HTTP-EQUIV="EXPIRES" CONTENT="Mon, 22 Jul 2002 11:12:01 GMT" /> | The date and time after which the document should be considered expired. An illegal EXPIRES date, e.g. "0", is interpreted as "now". Setting EXPIRES to 0 may thus be used to force a modification check at each visit. Web robots may delete expired documents from a search engine, or schedule a revisit. HTTP 1.1 (RFC 2068) specifies that all HTTP date/time stamps MUST be generated in Greenwich Mean Time (GMT) and in RFC 1123 format. |
Keywords | <META NAME="KEYWORDS" CONTENT="sex, drugs, rock & roll" /> | The keywords are used by some search engines to index your document in addition to words from the title and document body. Typically used for synonyms and alternates of title words. Consider adding frequent misspellings. e.g. heirarchy, hierarchy. |
PRAGMA NO-CACHE | <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE" /> | This directive indicates cached information should not be used and instead requests should be forwarded to the origin server. This directive has the same semantics as the CACHE-CONTROL:NO-CACHE directive and is provided for backwards compatibility with HTTP/1.0. Clients SHOULD include both PRAGMA:NO-CACHE and CACHE-CONTROL:NO-CACHE when a no-cache request is sent to a server not known to be HTTP/1.1 compliant. HTTP/1.1 clients SHOULD NOT send the PRAGMA request-header. HTTP/1.1 caches SHOULD treat "PRAGMA:NO-CACHE" as if the client had sent "CACHE-CONTROL:NO-CACHE". Also see EXPIRES. |
Refresh | <META HTTP-EQUIV="REFRESH" CONTENT="15;URL=http://www.I18nGuy.com/index.html" /> | Specifies a delay in seconds before the browser automatically reloads the document. Optionally, specifies an alternative URL to load, making this command useful for redirecting browsers to other pages. |
ROBOTS | <META NAME="ROBOTS" CONTENT="ALL" /> <META NAME="ROBOTS" CONTENT="INDEX,NOFOLLOW" /> <META NAME="ROBOTS" CONTENT="NOINDEX,FOLLOW" /> <META NAME="ROBOTS" CONTENT="NONE" /> | CONTENT="ALL | NONE | NOINDEX | INDEX| NOFOLLOW | FOLLOW | NOARCHIVE" default = empty = "ALL" "NONE" = "NOINDEX, NOFOLLOW" The CONTENT field is a comma separated list: |
GOOGLEBOT | <META NAME="GOOGLEBOT" CONTENT="NOARCHIVE" /> | In addition to the ROBOTS META Command above, Google supports a GOOGLEBOT command. With it, you can tell Google that you do not want the page archived, but allow other search engines to do so. If you specify this command, Google will not save the page and the page will be unavailable via its cache. See Google's FAQ. |
Friday, December 19, 2008
CSS Hacks
e.g:
*html body { <- only ie6 sees this
color: #FF0000;
}
*:first-child+html body { <- only ie7 sees this
color: #FF0000;
}
body:nth-of-type(1) body { <- only safari and chrome see this
color: #FF0000;
}
body {
_color: #FF0000; <- only ie6 sees this
}
more info: http://www.webdevout.net/css-hacks