Note that there are some explanatory texts on larger screens.

plurals
  1. POFix for background-position in IE
    primarykey
    data
    text
    <p>I get this problem in IE7 when running a piece of code that uses jquery and 2 jquery plugins. The code works in FF3 and Chrome.</p> <p>The full error is:</p> <pre><code>Line: 33 Char: 6 Error: bg is null or not an object Code: 0 URL: http://localhost/index2.html </code></pre> <p>However line 33 is a blank line.</p> <p>I am using 2 plugins: draggable and zoom. No matter what I do to the code it is always line 33 that is at fault. I check the source has update via view source but I feel this could be lying to me.</p> <pre><code>&lt;body&gt; &lt;div id="zoom" class="zoom"&gt;&lt;/div&gt; &lt;div id="draggable" class="main_internal"&gt;&lt;img src="tiles/mapSpain-smaller.jpg" alt=""&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#draggable').drag(); $('#zoom').zoom({target_div:"draggable", zoom_images:new Array('tiles/mapSpain-smaller.jpg', 'tiles/mapSpain.jpg') }); }); &lt;/script&gt; &lt;/body&gt; </code></pre> <p>Essentially what I am trying to do is recreate the Pragmatic Ajax map demo with jQuery.</p> <hr> <p>It would appear that the second line of this snippet is causing the trouble:</p> <pre><code>bg = $(this).css('background-position'); if(bg.indexOf('%')&gt;1){ </code></pre> <p>It seems to be trying to select the background-position property of <code>#draggable</code> and not finding it? Manually adding a <code>background-position: 0 0;</code> didn't fix it. Any ideas on how to get around this problem?</p> <p>I tried using the MS Script Debugger but that is nearly useless. Can't inspect variables or anything else.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload