DelphiFAQ Home Search:
General :: Web publishing :: JavaScript :: Document


Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Move an IFRAME 10 pixels to the right

Question:

I need to move an IFRAME 10 pixels to the right. Is that possible in JavaScript?

Answer:

Thanks to CSS you can position your IFRAME like all other HTML elements through the style.left property. The code sample from below moves the IFRAME titled 'anIframe' 10 pixels to the right.

<SCRIPT>
 function moveRight () {
   var ifr = document.all ? 
               document.all['anIframe'] : 
               document.getElementById('anIframe');
   ifr.style.left = (parseInt(ifr.style.left) + 10) + 'px';
 }
 </SCRIPT>
 

Generated 12:02:27 on Nov 23, 2017