snach15 Posted January 18, 2011 Report Share Posted January 18, 2011 sveiki .. kā lai norāda kordinātes tieši uz kādu vietu kuru es caur iframe gribu parādīt nevis kad visa web lapa rādas ... man piemēram vajadzētu tur mazu daļu kautkur no php.lv tiesi pa vidu parādīt caur iframe .. kā to var panākt? <html> <body> <iframe src="http://php.lv" height="500" width="800" frameborder="0" scrolling="no"></iframe> </body> </html> Quote Link to comment Share on other sites More sharing options...
snach15 Posted January 18, 2011 Author Report Share Posted January 18, 2011 kur esmu pieļāvis kļūdu? <html> <body> <iframe src="http://php.lv" name="myIframe" height="180" width="180" frameborder="0"></iframe> <script type="text/javascript"> var myIframe = document.getElementById('iframe'); myIframe.onload = function () { myIframe.contentWindow.scrollTo(150,15); } </script> </body> </html> Quote Link to comment Share on other sites More sharing options...
snach15 Posted January 18, 2011 Author Report Share Posted January 18, 2011 kur esmu pieļāvis kļūdu? <html> <body> <iframe src="http://php.lv" id="iframe" height="180" width="180" frameborder="0"></iframe> <script type="text/javascript"> var myIframe = document.getElementById('iframe'); myIframe.onload = function () { myIframe.contentWindow.scrollTo(150,15); } </script> </body> </html> Quote Link to comment Share on other sites More sharing options...
indoom Posted January 18, 2011 Report Share Posted January 18, 2011 tas scrollTo varētu nedarboties, jo php.lv ir cits domēns, un js nedarbojas uz cita domēna. (crossdomain aizsadzība) Quote Link to comment Share on other sites More sharing options...
marcis Posted January 18, 2011 Report Share Posted January 18, 2011 <div style="width: 180px; height: 180px; border: 1px solid #ccc; overflow: hidden;position:relative"> <div style="width: 800px; height: 600px; border: 1px solid #ccc;top:-15px;left:-150px;position:absolute"> <iframe src="http://gign.lv" scrolling="no" frameborder="0" height="600px" width="800px"></iframe> </div> </div> Quote Link to comment Share on other sites More sharing options...
snach15 Posted January 18, 2011 Author Report Share Posted January 18, 2011 paldies! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.