Bug Tracker

Opened 13 years ago

Closed 12 years ago

#1017 closed bug (wontfix)

imagebox variables conflict with DOM objects with the same ID (ex: "container") in IE6/7

Reported by: wick Owned by: stefan
Priority: major Milestone:
Component: interface Version: 1.1.2
Keywords: imagebox, unscoped, variables, conflict, IE6, IE7 Cc:
Blocked by: Blocking:

Description (last modified by scott.gonzal)

When an DOM object exists with an ID that matches one of the improperly scoped Imagebox (v1.2) variables used in imagebox.js (container, nextImage etc), the Imagebox init process causes a javascript error in IE (6 or 7) & the imagebox does not function. I believe this is due to conflicts with IE's shorthand DOM references. Properly scoping the Imagebox variables appears to solve the issue.

For example, the presence of <div id="container">..</div> anywhere in web page will produce in the error.

Change History (3)

comment:1 in reply to:  description Changed 13 years ago by wick

oops, this is a dup of bug #917 "ie problem"

comment:2 Changed 13 years ago by versatilia

(adding note to this bug rather than #917 because it's better described)

We hit this bug too - line 362 of imagebox.js sets a variable called 'gallery'. If you have a <div id="gallery"> then it'll just abandon the function at that point. Behaviour is strange - no IE script errors but the function literally gets abandoned, eg:

 <div id="gallery">
 <a href="blah" rel="test">test</a>
 </div>
 ...
 <script>
 jQuery("a[@rel=test]").each( function(){ $(this).bind('click',function(){
      alert("entering onclick function");
      gallery="some value"; // setting a variable with the same name as an ID
      alert("this will not be displayed in IE6");
      return false; // this is not executed in IE6
 });});
 </script>

comment:3 Changed 12 years ago by scott.gonzal

Description: modified (diff)
need: Review
Resolution: wontfix
Status: newclosed

Interface is no longer supported; consider switching to jQuery UI.

Note: See TracTickets for help on using tickets.