Hi,
I'm trying to implement a tool bar. I found this code ( Tales of a JavaScript Ninja | Amir Harel
Code:<html> <head> <script $(document).ready(main); function main() { $('iframe').attr('src', getIframeUrl() ); registerEvents(); resizeIframe(); } function getIframeUrl() { var url = window.location.href; var iframe_url = 'http://www.nowaythatthereissomethinghere.com'; var param_start = url.indexOf("iframe="); if( param_start != -1 ) iframe_url = url.substr(param_start+7,url.length-param_start-7); if( iframe_url.indexOf("http://") == -1) iframe_url = "http://" + iframe_url; return iframe_url; } function resizeIframe() { $("#iframe").height( WindowHeight() - getObjHeight(document.getElementById("toolbar")) ); } function WindowHeight() { var de = document.documentElement; return self.innerHeight || (de &amp;amp;&amp;amp; de.clientHeight ) || document.body.clientHeight; } function getObjHeight(obj) { if( obj.offsetWidth ) { return obj.offsetHeight; } return obj.clientHeight; } $(window).resize( function() {resizeIframe();} ); </script> </head> <body> <div id='toolbar'> <div id='search'> <input id='qs' type='text' size='35' ></input> <input type='button' value='search' id='searchBtn' ></input> </div> <div id='main'> <div id='links'> <a id='back' href='javascript:void(0);'>Go back</a> <a id='twitter' href='javascript:void(0);'></a> <a id='arrow' href='javascript:void(0);'></a> <a id='close' href='javascript:void(0);'></a> </div> <div id='extra'> <br> Is that alright? Give my gun away when it's loaded <br> Is that alright? If you don't shoot it how am I supposed to hold it <br> Is that alright? Give my gun away when it's loaded <br> Is that alright With you? </div> </div> </div> <div id='iframe'> <iframe src='' /> </div> </body> </html>
this is not working as it should but I can not find the error. Any of you can tell me what I'm doing wrong?

LinkBack URL
About LinkBacks





Reply With Quote
Bookmarks