http://brownsteel.com.au/

I have an issue that whenever the lightbox scripts are called on a page
the pop out menu behaves strangely:

- In IE7 it won't close once opened.
- In FF 3 it won't reopen after it has opened and closed once.

an example of this can be seen on this page -

I feel that it is some sort of conflict as when i comment out the lightbox scripts the menu works fine in both browsers listed.

Any Ideas?

Thanks
lance Craig

Dani AI

Generated

Building on the reports from and and 's note about load-order/globals, here is a compact, practical checklist and fixes that typically resolve Fireworks-exported menu vs. lightbox/overlay conflicts.

  • Reproduce on a minimal page and watch the browser console for errors (use Developer Tools / Firebug). JS exceptions often stop subsequent handlers.

  • Check for duplicate libraries and load order. If jQuery and another framework are present, call jQuery.noConflict() and use a private alias:

    var $j = jQuery.noConflict();
    $j(function(){ /* use $j(...) */ });

    (see jQuery.noConflict)

  • Encapsulate Fireworks-generated code so it does not leak globals. Wrap exports in an IIFE or a namespace before editing:

    (function(){
      // Fireworks code moved here to avoid global names
    })();
  • Avoid replacing existing onclick/onload handlers; add listeners instead and stop unwanted bubbling:

    function handler(e){
      e = e || window.event;
      if (e.stopPropagation) e.stopPropagation();
      else e.cancelBubble = true;
      /* handler body */
    }
    if (el.addEventListener) el.addEventListener('click', handler, false);
    else if (el.attachEvent) el.attachEvent('onclick', handler);

    (see addEventListener and stopPropagation)

  • Check overlays and stacking: an overlay left visible or with higher stacking context can block menu clicks. Either ensure the overlay is removed/hidden on close, or raise the menu z-index and ensure it has a positioned ancestor:

    #menu { position: relative; z-index: 10000; }

    (stacking contexts explained at Understanding z-index)

  • Work on a copy (don't edit original exported file directly — re-exporting will overwrite manual edits).

These steps remove most namespace, event, and z-index problems commonly seen with Fireworks exports and lightbox-style scripts.

Recommended Answers

All 3 Replies

bump...

http://brownsteel.com.au/

I have an issue that whenever the lightbox scripts are called on a page
the pop out menu behaves strangely:

- In IE7 it won't close once opened.
- In FF 3 it won't reopen after it has opened and closed once.

an example of this can be seen on this page -

I feel that it is some sort of conflict as when i comment out the lightbox scripts the menu works fine in both browsers listed.

Any Ideas?

Thanks
lance Craig

************************
Hi!
I am experiencing right now the same problem while building a new website. I made pop menus with Fireworks, exported them and then added the 3 scripts for the lightbox (version2). The lightbox works but makes a conflict with my pop up menu. when i remove the 3 scripts my menus work again but not the lightbox.
Have you maybe solved the problem since then? If so i would be grateful for some advice as i dont want to give up my menus....

Thanks
nathalie

The creators of programs such as these expect their programs to be used alone.

Are the scripts in the body? If so only one of them will run when the page opens.

Another possibility is that they share a common variable name. If one script sets a global variable for one purpose, and then another one sets the same variable for a different purpose, the two scripts will have an unwanted interaction.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.