Hi, I have a 2 page whit names: default1.aspx and default2.aspx for go to default2: in default1.aspx i use the fancybox and use this code: $("a#inline").fancybox({ 'hideOnContentClick': false , 'scrolling': 'no', 'titleShow': false, 'type': 'iframe', }); goto default2 when i click the "goto default2" the default2 shown as a pop up page. but when user right click on "goto default2" and select New Tab, The default2 opened in normal mode in new page. BUT: I want: if (default2.aspx opened bay fancybox) then default2.panel1.visible=false if (default2.aspx opened in normal mode) then default2.panel1.visible=true How i do? Please Help me,
Well... You're trying to control a user's interaction with your webpage, which is never a good idea. You cannot control the user, so the best thing to do is creating a webpage that accomodates the user, no matter how stupid the user is. That being said, you could probably do something similar to this: On default2.aspx, you could have a jQuery-script run that checks if the content is loaded in a pop-up (iframe) or full window (probably, I'm just theorizing here) - and based on that, you could show or hide panel1. However, you need to understand that this won't really help - if the user choses to do it this way, s/he might also turn off javascript, and have to open the default2.aspx in another tab (the popup won't work without javascript running). However, you can make the panel1 visible by default, and chose to hide it with javascript if the user uses the regular, iframe way to show it - that will at least show the panel1 if the user is not using javascript, and when they chose to open it in another window/tab.