
![]() |
nathanr
swfobject is somewhat bulky and well not the same as just embedding via html, so I made this - will remove the click to deactivate from all flash on page load
function objectSkipActivate() { /* simple skip deactivate by nathanr */ var x = document.getElementsByTagName('OBJECT'); for(var ob = x.length - 1; ob >= 0; ob--) { var thisObjType = typeof(x[ob]); if(thisObjType.toLowerCase() == 'object') { /* build the object as valid xhtml */ var newObject = '<object type="'+x[ob].type+'" width="'+x[ob].width+'" height="'+x[ob].height+'" data="'+x[ob].data+'"'; if(x[ob].id) { newObject += ' id="'+x[ob].id+'"'; } var newStyle = x[ob].style; newObject += '>'; /* add in the params */ var oP = x[ob].childNodes; for(var p = oP.length - 1; p >= 0; p--) { newObject += '<param name="'+oP<>.name+'" value="'+oP<>.value+'" />'; } newObject += '</object>'; /* remake the object with the click to activate removed */ x[ob].outerHTML = newObject; /* add in the styles */ for(s in newStyle) { if(newStyle<>) { x[ob].style<> = newStyle<>; } } } } } /* if you use my event handlers aswell then simply uncomment the following */ #add_event('load',objectSkipActivate,window); just run it onload - jobs a goodun |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads