Ask questions and get good answers on jQuery

I am looking for a way to open a container and have it always on top until it is closed. Currently the active container moves to top position. Any ideas? thank you

BTW Matteo your work is fantastic thank you so much for sharing

asked Jan 19 '10 at 16:04

denelius's gravatar image

denelius
593

edited Jan 19 '10 at 18:56

Matteo%20Bicocchi's gravatar image

Matteo Bicocchi ♦♦
1776129


I'm working on the 2.5 release where there'll be a new metadata param to set a alwaysOnTop property for a specific container; I can't make it public jet but here is the changes you should do to the mbContainerPlus.js code for this feature:

line 96:

if (container.metadata().alwaysOnTop) container.css("z-index",100000).addClass("alwaysOnTop");

line 530:

replace the function jQuery.fn.mb_BringToFront with:

  jQuery.fn.mb_BringToFront= jQuery.fn.mb_bringToFront= function(){
    var zi=10;
    $('*').not(".alwaysOnTop").each(function() {
      if($(this).css("position")=="absolute" || $(this).css("position")=="fixed"){
        var cur = parseInt($(this).css('zIndex'));
        zi = cur > zi ? parseInt($(this).css('zIndex')) : zi;
      }
    });
    $(this).not(".alwaysOnTop").css('zIndex',zi+=1);
    return zi;
  };

On your container just add:

{alwaysOnTop:true, buttons:...}

answered Jan 19 '10 at 18:55

Matteo%20Bicocchi's gravatar image

Matteo Bicocchi ♦♦
1776129

Thanks Matteo this does the trick!

(Jan 22 '10 at 19:07) denelius

Hi Matteo I have noticed when applying the "alwaysOnTop:true" functionality that the mouse-over tooltip (name of container defined in

) appears behind the container. Is there a way to make this appear on top? thank you

(Mar 04 '10 at 20:33) denelius

I was not able to resolve this and I see the issue remains for the latest release. I did however manage to find a work around that uses the html 'title' functionality it is not as sexy as the jquery mouse-over tooltip but works. add the following to the img tag (line 370 of mbContainer.js) title='"+container.find(".n:first").text()+"' then comment out the .bind("mouseenter",function() on line 429 of mbContainer.js. These changes relate to the 2.4.8 release. Thanks again Matteo for your fantastic work!

(May 03 '10 at 21:13) denelius
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×1

Asked: Jan 19 '10 at 16:04

Seen: 1,269 times

Last updated: Jan 19 '10 at 18:56

Related questions

jQuery main site - Matteo Bicocchi