开发者

IE Javascript positioning

开发者 https://www.devze.com 2023-01-24 04:26 出处:网络
Can anyone tell me why the po开发者_运维百科sitioning via offsets is not working for Internet explorer when it works perfectly fine for all other browsers? Thank you in advance.

Can anyone tell me why the po开发者_运维百科sitioning via offsets is not working for Internet explorer when it works perfectly fine for all other browsers? Thank you in advance.

  <script type="text/javascript">
       var waitTime = 0, blackout = new AC.Blackout('blackout', {
       showOnce: false
       });

         if (navigator.appName == 'Microsoft Internet Explorer')
      {

      blackout.addImage('/images/background.jpg', { offsets: [-10050, 1000], dimensions: [1280, 884] });

      }
      else
      {

        blackout.addImage('/images/background.png', { offsets: [-150, 100], dimensions: [1280, 853] });
      blackout.addImage('/images/logo.png', { offsets: [-107, 0], dimensions: [248, 85] });
    }



      </script>


In IE, you need the apply the (position: absolute) for absolute positioning of an element in the page so before setting the x,y coordinate of an element you should apply this style to that element

< img src="someImageSrc" style="position: absolute; top: 10px; left: 40px"/>

0

精彩评论

暂无评论...
验证码 换一张
取 消