3

I have an image javascript button that it`s not working on chrome ,

would you please helping me Thanks in advance!

here is the code:

I just hide the pop up:

Edit :

for closing I`m using this function just hide it

function hideBulle() {
    $("bullepopup").style.display="none";
    hideoverlay();
}

and here is the code for creating one box and this button

  function showBulle(obj) {
    showoverlay();
    coo =   $("content").getPosition();
    $("bullepopup").style.width = "555px";
    $("bullepopup").style.height = "555px";
    $("bullepopup").position({x: (coo.x+((650-555)/2)), y: (coo.y+(440-250)/2)});
    $("bullepopup").style.display="";
    $("bullepopup").set('html','');
    new Element('img',{src:'images/br588.gif',styles: {float:'right',cursor:'pointer'},
                            events: {
                                click: function(){
                                hideBulle();
                                }
                            }
                        }).inject($('bullepopup'));

    new Element('br').inject($('bullepopup'));

    new Element('div',{html:obj.get('html')}).inject($('bullepopup'));
}
function hideBulle() {
    $("bullepopup").style.display="none";
    hideoverlay();
}

Thanks in advance!

Tim Down
  • 318,141
  • 75
  • 454
  • 536
  • what library are you using? That should be tagged – Ruan Mendes Oct 01 '12 at 19:51
  • what is the `Element` function? is that native javascript? what is `inject`? – jbabey Oct 01 '12 at 19:51
  • @JuanMendes I`m using /mootools-more-1.4.0.1.js that I put it already –  Oct 01 '12 at 20:01
  • @jbabey yes I create new element with new Element and with inject I will put it inside element –  Oct 01 '12 at 20:04
  • Do you want to change url of current window? As window.open('','_self',''); will make changes in own window because of self. – Anoop Oct 01 '12 at 20:09
  • @Shusl since I will load the popup, and this button is in this popup and just hide the pop up , check my edit please –  Oct 01 '12 at 20:21
  • What about this: http://stackoverflow.com/questions/2032640/problem-with-window-close-and-chrome – Peter Oct 01 '12 at 20:53

2 Answers2

6

check your css with chrome developer tool , you should have some frame in your button

remove or change it

you can try this code also

window.open('', '_self', ''); //bug fix
window.close();
AntonMac
  • 353
  • 3
  • 13
1

top.window.close() works for me. Tested on IE, FF, Chrome, Safari and Opera.

Ron
  • 245
  • 3
  • 9