Hello! People, help me figure it out. The site has a flash banner, you need to make it a link, tried everything I knew, describe the options that I tried:
The first option (the onclick attribute is registered to the OBJECT element itself) does not work, the redirect does not occur:
<object type="application/x-shockwave-flash" data="http://test.ru/banner.swf" height="150" width="200" onclick="'window.location = "http://ya.ru";'"> <param name="allowFullScreen" value="true" /> <param name="allowScriptAccess" value="always" /> <param name="movie" value="http://test.ru/banner.swf" /> </object>
Option 2 (did a DIV wrapper for the OBJECT element) - does not work, redirect does not occur ::
<div onclick="redirectionLink();" style="width: 200px; height: 150px;"> <object type="application/x-shockwave-flash" data="http://test.ru/banner.swf" height="150" width="200" onclick="'window.location = "http://ya.ru";'"> <param name="allowFullScreen" value="true" /> <param name="allowScriptAccess" value="always" /> <param name="movie" value="http://test.ru/banner.swf" /> </object> </div> <script type="text/javascript"> function redirectionLink() { window.location = "http://ya.ru"; } </script>
The third option (created the DIV block and placed it over the OBJECT element, the onclick event registered the DIVʻu) - works only in Crhome, in other browsers my DIV is under the OBJECT element:
<div style="width: 200px; height: 150px; border: 1px solid black; position: relative; z-index: 99999; top: -150px;" onclick="redirectionLink();"> </div> <object type="application/x-shockwave-flash" data="http://test.ru/banner.swf" height="150" width="200" onclick="'window.location = "http://ya.ru";'"> <param name="allowFullScreen" value="true" /> <param name="allowScriptAccess" value="always" /> <param name="movie" value="http://test.ru/banner.swf" /> </object> <script type="text/javascript"> function redirectionLink() { window.location = "http://ya.ru"; } </script>